Parallax Boe-Bot Student Manual page 164

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

Page 150 · Robotics with the Boe-Bot
FREQOUT 4, 2000, 3000
' -----[ Main Routine ]-------------------------------------------------------
DO UNTIL (instruction = "Q")
READ address, instruction
address = address + 1
SELECT instruction
CASE "F": GOSUB Forward
CASE "B": GOSUB Backward
CASE "L": GOSUB Left_Turn
CASE "R": GOSUB Right_Turn
ENDSELECT
LOOP
END
' -----[ Subroutine - Forward ]-----------------------------------------------
Forward:
FOR pulseCount = 1 TO 64
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
RETURN
' -----[ Subroutine - Backward ]----------------------------------------------
Backward:
FOR pulseCount = 1 TO 64
PULSOUT 13, 650
PULSOUT 12, 850
PAUSE 20
NEXT
RETURN
' -----[ Subroutine - Left_Turn ]---------------------------------------------
Left_Turn:
FOR pulseCount = 1 TO 24
PULSOUT 13, 650
PULSOUT 12, 650
PAUSE 20
NEXT
RETURN
' Signal program start/reset.
' Data at address in instruction.
' Add 1 to address for next read.
' Call a different subroutine
' for each possible character
' that can be fetched from
' EEPROM.
' Stop executing until reset.
' Forward subroutine.
' Send 64 forward pulses.
' 1.7 ms pulse to left servo.
' 1.3 ms pulse to right servo.
' Pause for 20 ms.
' Return to Main Routine loop.
' Backward subroutine.
' Send 64 backward pulses.
' 1.3 ms pulse to left servo.
' 1.7 ms pulse to right servo.
' Pause for 20 ms.
' Return to Main Routine loop.
' Left turn subroutine.
' Send 24 left rotate pulses.
' 1.3 ms pulse to left servo.
' 1.3 ms pulse to right servo.
' Pause for 20 ms.
' Return to Main Routine loop.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Boe-Bot and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF