Using InO-Bot’s Sensors
InO-Bot has a light sensor that reports a value for ambient light between 0 and 1. The higher the value, the brighter the ambient light.
The following command will turn on InO-Bot’s headlights if the ambient light is measured as less than 0.5.
IF (GPROP “INOBOT “LIGHT) < .5 THEN PPROP “INOBOT “LIGHTS [1 1]
InO-Bot contains a microphone which records ambient noise levels. The higher the value the higher the noise level detected.
The following command retrieves the current noise level detected by InO-Bot’s microphone.
GPROP “INOBOT “NOISELEVEL
Try detecting the noise level when InO-Bot is in a quiet environment and when music is playing to calibrate the differences in value. When InO-Bot is moving, the microphone detects the noise of the motors so NOISELEVEL reports a higher value that when InO-Bot is stationery.
InO-Bot has four proximity sensors Distance Sensor
InO-Bot has a sensor in front between its headlights that can sense objects in its way and report how far away they are. The DISTANCE property reports the distance in centimeters from the front of InO-Bot to the nearest object. This value may be used to help InO-Bot avoid objects while moving.
The following command reports the distance from InO-Bot to the nearest object in front of the robot.
GPROP “INOBOT “DISTANCE Result: 14