Page 140 - The Unofficial Guide to Lego Mindstorms Robots
P. 140

129


          LCD_REFRESH ( -- )
          Use this word after making changes to the display. The state of the display will not change until you call LCD_REFRESH.



















                                                        Figure 6-3.
                                                     The RCX's display

          pbFORTH can displa y a number from the stack with the following word:

          L CD_NUMBER (decimal value signed -- )
          This word shows the  number value on the display. The decimal parameter controls the location of the decimal point, if
          t here is one, while the  signed parameter determines whether value is shown as signed or unsigned. The acceptable values
          of decimal and signed are shown in Table 6-5 and Table 6-6.

          Table 6-5. Values for the decimal Parameter of LCD_NUMBER

          Value (in hexadecimal)          Description

          3002                        No  decimal  point

          3003                        One  digit after  the decimal point

          3004                        Two digits  after the  decimal  point

          3005                        Three  digits  after the  decimal  point

          any value                       Single digit on the right of the display (use 3017 for  signed)

          Table 6-6. Values for the signe d Parameter of LCD_NUMBER

          Value (i n hexadecimal)           Description

          3001                        Signed,  no  leading zeros

          301F                        Unsigned with leading zeros

          3017                        Single digit  on  the right  of  the  display  (ignores decimal)

          For example, to display the num ber -4198, use the following:

              3002 -1066 3001 LCD_NUMBER LCD_REFRESH
   135   136   137   138   139   140   141   142   143   144   145