EasyManuals Logo

Parallax Boe-Bot User Manual

Parallax Boe-Bot
360 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #163 background imageLoading...
Page #163 background image
Chapter 4: Boe-Bot Navigation · Page 149
while a certain condition exists. Our example program will use DO…LOOP UNTIL
(condition)
. In this case, it causes the DO…LOOP to keep repeating until the character
“Q” is read from EEPROM.
A
SELECT...CASE...ENDSELECT statement can be used to select a variable and evaluate it
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
instruction variable and then call the
appropriate subroutine for each instance, or case, of a given letter.
SELECT instruction
CASE "F": GOSUB Forward
CASE "B": GOSUB Backward
CASE "R": GOSUB Right_Turn
CASE "L": GOSUB Left_Turn
ENDSELECT
Here are these concepts, all together in a single program.
Example Program: EepromNavigation.bs2
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.
' Robotics with the Boe-Bot - EepromNavigation.bs2
' Navigate using characters stored in EEPROM.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
DEBUG "Program Running!"
' -----[ Variables ]----------------------------------------------------------
pulseCount VAR Word ' Stores number of pulses.
address VAR Byte ' Stores EEPROM address.
instruction VAR Byte ' Stores EEPROM instruction.
' -----[ EEPROM Data ]--------------------------------------------------------
' Address: 0123456789 ' These two commented lines show
' |||||||||| ' EEPROM address of each datum.
DATA "FLFFRBLBBQ" ' Navigation instructions.
' -----[ Initialization ]-----------------------------------------------------

Table of Contents

Other manuals for Parallax Boe-Bot

Questions and Answers:

Question and Answer IconNeed help?

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

Parallax Boe-Bot Specifications

General IconGeneral
BrandParallax
ModelBoe-Bot
CategoryRobotics
LanguageEnglish