EasyManua.ls Logo

LEGO MINDSTORMS Robots

LEGO MINDSTORMS Robots
226 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Table 6-8. Input Type Values
Value Description
0 Raw
1 Touch senso
2 Temperature sensor
(table continued on next page)
Page 132
(table continued from previous page)
Table 6-8. Input Type Values (continued)
Value Description
3 Light sensor
4 Rotation sensor
SENSOR_MODE (mode index -- )
This word sets the mode of the given input. An input's mode determines how the sensor values will be interpreted. The modes are shown in Table 6-9.
Table 6-9. Input Mode Values
Value (hexadecimal) Description
0 Raw sensor value from 0 to 1023
20 Boolean, either 1 or 0
40 Counts transitions from 1 to 0 and vice versa (edge counting)
60 Counts transitions from 1 to 0 (pulse counting)
80 Percent from 0 to 100
A0 Celsius temperature
C0 Fahrenheit temperature
E0 Shaft angle, 16 counts per full revolution
The following example shows how you could configure input 3 for a light sensor:

Table of Contents

Related product manuals