Object «brick»
This article is automatically translated from Russian by Google Translator.
The object "brick" represents the TRIK controller and provides access to the robot devices.
Method
Description
Provides access to the accelerometer.
Provides access to battery information.
Provides access to the color sensor by the camera.
Provides access to the display of the robot.
Provides access to the encoder on the specified port.
Get a photo from the camera as an array of bytes.
Provides access to the gyroscope.
Provides access to the buttons on the body of the robot.
Play the audio file.
Provides access to the LED on the body of the robot.
Provides access to the line sensor by the camera.
Provides access to the motor on the specified port.
Provides access to the object sensor by the camera.
Pronounce the string passed as a parameter (in Russian or English).
Provides access to the sensor on the specified port.
Stops all motors and active sensors, and removes what is drawn on the display.
accelerometer
Provides access to the accelerometer (class "Accelerometer").
Syntax
battery
Provides access to battery information (class "Battery").
Syntax
colorSensor
Provides access to the color sensor by the camera (class "ColorSensor").
Syntax
display
Provides access to the display of the robot (class "Display").
Syntax
encoder
Provides access to the encoder on the specified port (class "Encoder").
Syntax
As a parameter, you must specify the port.
Example
getStillImage
Get a photo from the camera as an array of bytes.
Syntax
gyroscope
Provides access to the gyroscope (class "Gyroscope").
Syntax
keys
Provides access to the buttons on the robot body (class "Keys").
Syntax
led
Provides access to the LED on the robot body (class "Led").
Syntax
lineSensor
Provides access to the line sensor by the camera (class "LineSensor").
Syntax
motor
Provides access to the motor (power or servomotor) on the specified port (class "Motor").
Syntax
As a parameter, you must specify the port.
Example
objectSensor
Provides access to the object sensor by the camera (class "ObjectSensor").
Syntax
playSound
Play the audio file.
Syntax
As a parameter, you must specify the name of the file with an absolute path or the path relative to the folder trik
on the controller.
Warning! The file must be pre-loaded on the controller.
Example
say
Say the line (in Russian or English).
Syntax
As a parameter, you must specify a string in English or Russian.
Example
sensor
Provides access to the sensor on the specified port (class "Sensor").
Syntax
As a parameter, you must specify the port.
Example
stop
Stops all motors and active sensors, and removes what is drawn on the display.
Syntax
Last updated