Sensory variables for the TRIK controller

This article is automatically translated from Russian by Google Translator.

Sensor variables are reserved variables for getting readings of the sensors connected to the corresponding ports.

These values can be assigned to variables and used in mathematical expressions.

Variable changes can be tracked as you go through the program in the variable table.


An array of three elements containing accelerometer readings on the X, Y, and Z axis, respectively.


x = accelerometer[0]; -- X-axis accelerometer readings
y = accelerometer[1]; -- Y-axis accelerometer readings
z = accelerometer[2]; -- Z-axis accelerometer readings

colorSensorR, colorSensorG, colorSensorB

The color sensor readings by the camcorder in the center of the frame are the intensity of red, green, and blue, respectively. They are only updated when the color sensor is turned on and initialized.

Possible values

From 0 to 255.


r = colorSensorR; -- red intensity
g = colorSensorG; -- green intensity
b = colorSensorB; -- blue intensity

gamepadPad1, gamepadPad2

The coordinates of pressing the active areas on the remote control.

Each variable stores an array of two elements corresponding to the coordinate of the click point.

Possible values

From (-100, -100) to (100, 100), (-100, -100) - top left corner of the active area. (-101, -101) - if there is no click.


An array of three elements containing the gyroscope readings on the X, Y, and Z-axis respectively.


x = gyroscope[0]; -- X-axis gyroscope readings
y = gyroscope[1]; -- Y-axis gyroscope readings
z = gyroscope[2]; -- Z-axis gyroscope readings


An array of three elements containing camera readings inline sensor mode. The values are updated when the sensor is on and initialized.

Last updated