Use this command to set the mode of the given input. While the SetSensorType() command is used to specify the electrical characteristics of the input, the SetSensorMode() command
specifies how the input value should be processed. The modes are listed in Table 4-3.
Table 4-3. Input Mode Constants
Mode Constant
SENSOR_MODE_RAW
SENSOR_MODE_BOOL
SENSOR_MODE_EDGE
SENSOR_MODE_PULSE
SENSOR_MODE_PERCENT
SENSOR_MODE_CELSIUS
SENSOR_MODE_FAHRENHEIT
SENSOR_MODE_ROTATION
Internally, input values initially have a raw value from 0 to 1023. Raw values are converted to the input values that your program sees by a process that depends on the input mode. Three of the
modes count events: SENSOR_MODE_EDGE, SENSOR_MODE_PULSE, and SENSOR_MODE_ROTATION. The other modes perform a mathematical scaling operation on the raw input value.
For example, if the input mode is SENSOR_MODE_PERCENT, the RCX converts the raw value into a percent according to the equation:
Need help?
Do you have a question about the MINDSTORMS Robots and is the answer not in the manual?
Questions and answers