Datasheet
Page 52ยท Applied Robotics with the SumoBot
DEBUG CR,
"Enter up to 20 values", CR,
"between 100 and 1000", CR,
"Press 0 (zero) when done", CR,
">"
counter = 0
DO UNTIL counter >= 40 OR temp = 0
DEBUGIN DEC temp
WRITE Values + counter, Word temp
counter = counter + 2
DEBUG ">"
LOOP
The temp variable is then used to get a character from the Debug Terminal's Transmit
windowpane and use it to make a decision.
' Display & compare values? (y/n)
DEBUG CR, "Compare values to ", CR,
"threshold? (y/n)", CR,
">"
DEBUGIN temp
' Display and compare values
IF temp = "y" OR temp = "Y" THEN
Finally, temp is used to store successive values that get fetched from EEPROM. In this
case,
counter is re-used as a loop counter, and a third variable, compare, is used to store
the threshold value for comparison.
' Display and compare values
IF temp = "y" OR temp = "Y" THEN
DEBUG CR,
" Threshold", CR,
"Value Comparison", CR,
"---------- ----------", CR
counter = 0
READ Threshold, Word compare
DO UNTIL counter >= 40 OR temp = 0
READ Values + counter, Word temp