The system variable rotationZ always contains the rotation of the device along the z axis. If the sketch angleMode() is set to DEGREES, the value will be 0 to 360. If it is set to RADIANS, the value will be 0 to 2*PI.
Unlike rotationX and rotationY, this variable is available for devices with a built-in compass only.
Note: The order the rotations are called is important, ie. if used together, it must be called in the order Z-X-Y or there might be unexpected behaviour.
Examples
Related References
accelerationX
The system variable accelerationX always contains the acceleration of the device along the x axis.
accelerationY
The system variable accelerationY always contains the acceleration of the device along the y axis.
accelerationZ
The system variable accelerationZ always contains the acceleration of the device along the z axis.
deviceMoved
The deviceMoved() function is called when the device is moved by more than the threshold value along X, Y or Z axis.