Sensor Tag model element

SensorTag provides access to the external sensor tag hardware.

Usage

To add the SensorTag 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

sensorTag.start(); // Starts the accelerometer
var data = sensorTag.readData(); // Reads the current acceleration 
_println("The acceleration on the X component is " + data.x);
_println("The acceleration on the Y component is " + data.y);
_println("The acceleration on the Z component is " + data.z);
sensorTag.stop(); // Stops the accelerometer