Gyroscope model element

Gyroscope provides access to the built-in sensor that provides the rate of rotation around the x,y,z axes.

Usage

To add the Gyroscope element to your model, drag the icon element to the list of your model elements.

The element implements the following basic methods:

Example of use

gyroscope.start(); // Starts the accelerometer
var data = gyroscope.readData(); // Reads the current acceleration 
_println("The rotation rate around the X axis is " + data.x);
_println("The rotation rate around the Y axis is " + data.y);
_println("The rotation rate around the Z axis is " + data.z);
gyroscope.stop(); // Stops the accelerometer