Chapter 4: Boe-Bot Navigation
· Page 155
pulseLeft VAR Word
' -----[ EEPROM Data ]--------------------------------------------------------
' addressOffset 0 2 4 6 8
Pulses_Count DATA
Word 64, Word 24, Word 24, Word 64, Word 0
Pulses_Left DATA
Word 850, Word 650, Word 850, Word 650
Pulses_Right DATA
Word 650, Word 650, Word 850, Word 850
' -----[ Initialization ]-----------------------------------------------------
FREQOUT 4, 2000, 3000 ' Signal program start/reset.
' -----[ Main Routine ]-------------------------------------------------------
DO
READ Pulses addressOffset, Word pulseCount
READ Pulse addressOffset, Word pulseLeft
READ Pulses addressOffset, Word pulseRight
addressOffset = address 2
FOR counter = 1 TO pulseCount
PULSOUT 13, pulseLeft
PULSOUT 12, pulseRight
PAUSE 20
NEXT
LOOP UNTIL (pulseCount = 0)
END ' Stop executing until reset.
Did your Boe-Bot perform the familiar forward-left-right-backwards movements? Are
you thoroughly bored with it by now? Do you want to see your Boe-Bot do something
else, or to choreograph your own routine?
Your Turn – Making Your Own Custom Navigation Routines
√
Save EepromNavigationWithWordValues.bs2. under a new name.
√
Replace the
DATA
directives with the ones below.
√
Run the modified program and see what your Boe-Bot does.
Pulses_Count DATA Word 60, Word 80, Word 100, Word 110,
Word 110, Word 100, Word 80, Word 60, Word 0
Pulses_Left DATA Word 850, Word 800, Word 785, Word 760, Word 750,