input.onGesture allows to run code on a number of pre-defined gestures such as shake, freefall or various orientation events.
input.acceleration returns the immediate acceleration for a given direction in milli-g, e.g. 1/1000 of a g. The measure includes earth gravity (1000mg) You can query
Z or the
If you look closely at the center of the Circuit Playground, you will see the accelerometer axis printed on the board.
Assuming the board is at rest on a table,
Xaxis is aligned horizontally from left to right. If you tilt left,
Xis negative, tilt right
Yaxis is aligned vertically from bottom to top. If you tilt forward,
Yis positive, tilt backward
Zaxis is perpendicular to the board and pointing down. At rest,
Zis aligned with earth gravity.