Sensors

Sensors are grouped in the sensors group and all hardware devices (sensors + motors + battery + beeper) are grouped in the hardware group.

Bumper

The switch device in front of the robot is called bumper. Its value is 1 if it is pressed, 0 otherwise.

Sonar

The ultrasonic sensor is called sonar.

Its value is the distance measured by the sensor in centimeters between 0 and 255. When the read operation fails, 255 is returned.

Decibel

The sound sensor is called decibel.

Its value relates the level of ambient sound. It is between 0 and 1.

Two different modes can be used by changing the .mode attribute to "DB" or "DBA".

  • "DBA" is a mode measuring only frequencies between 200 and 14000Hz.
  • "DB" measures a wider band.

Default value is "DBA".

Light

The light sensor is called light.

The value returned is between 0 an 1 representing the amount of light measured.

Three different modes are available by changing the .mode attribute.

  • "Reflector" means the sensor lights on its led and measures the light reflected.
  • "Ambiant" lights off the led and measures the ambiant light.
  • "Normal" lights off the led too and return the raw value measured.

Default value is "Reflector".