28125 Parallax Inc, 28125 Datasheet - Page 163

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
while a certain condition exists.
(condition)
“Q” is read from EEPROM.
A
on a case-by-case basis and execute code blocks accordingly. Here is the code block that
will look at each letter value held in the
appropriate subroutine for each instance, or case, of a given letter.
Here are these concepts, all together in a single program.
Example Program: EepromNavigation.bs2
' Robotics with the Boe-Bot - EepromNavigation.bs2
' Navigate using characters stored in EEPROM.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
' -----[ Variables ]----------------------------------------------------------
pulseCount
address
instruction
' -----[ EEPROM Data ]--------------------------------------------------------
'
'
DATA
' -----[ Initialization ]-----------------------------------------------------
SELECT
Address: 0123456789
Carefully read the code instructions and comments in EepromNavigation.bs2 to
understand what each part of the program does.
Enter, save, and run EepromNavigation.bs2.
...
SELECT instruction
ENDSELECT
CASE
CASE "F": GOSUB Forward
CASE "B": GOSUB Backward
CASE "R": GOSUB Right_Turn
CASE "L": GOSUB Left_Turn
. In this case, it causes the
VAR
VAR
VAR
"FLFFRBLBBQ"
...
||||||||||
ENDSELECT
Word
Byte
Byte
statement can be used to select a variable and evaluate it
Our example program will use
DO…LOOP
instruction
' Stamp directive.
' PBASIC directive.
' Stores number of pulses.
' Stores EEPROM address.
' Stores EEPROM instruction.
' These two commented lines show
' EEPROM address of each datum.
' Navigation instructions.
to keep repeating until the character
variable and then call the
DO…LOOP UNTIL

Related parts for 28125