301B no Low battery indicator
301C no Short range download indicator
(table continued on next page)
Page 131
(table continued from previous page)
Table 6-7. LCD Segment Numbers (continued)
Segment Number
(hexadecimal)
Sequence? Description
301D no Long range download indicator
3020 no
All segment (
LCD_SHOW only)
Conveniently, you can clear the entire display with a single word:
LCD_CLEAR ( -- )
This word clears the RCX's display so that no segments are lit.
Input Control Words
Before you configure inputs or read values from them, you should initialize pbFORTH's input system with the following word:
SENSOR_INIT ( -- )
This word initializes pbFORTH's input system. Call it once before working with inputs.
Configuring inputs
You probably remember that the RCX's inputs may be powered. The light sensor, for example, is powered from an input. These types of sensors are called active, all others are passive. In
pbFORTH, the following words determine whether an input is active or passive:
SENSOR_ACTIVE (index -- )
SENSOR_PASSIVE (index -- )
These words set the input described by index to be active (powered) or passive. The index value should be 0, 1, or 2, corresponding to input 1, 2 or 3.
You can configure an input for a particular type and mode, just as in NQC:
SENSOR_TYPE (type index -- )
This word sets the type of an input, which describes the electrical characteristics of the sensor you. plan to attach. The values for type are shown in Table 6-8. As before, index should be 0, 1,
or 2.