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 #168 background imageLoading...
Page #168 background image
Page 154 · Robotics with the Boe-Bot
LOOP UNTIL (pulseCount = 0)
The first time through the loop,
addressOffset = 0. The first READ command will
retrieve a value of 64 from the first address at the
Pulses_Count label, and place it in the
pulseCount variable. The second READ command retrieves a value of 850 from the first
address specified by the
Pulses_Left label, and places it in the pulseLeft variable.
The third
READ command retrieves a value of 650 from the first address specified by the
Pulses_Right label and places it in the pulseRight variable. Notice that these are the
three values in the “0” column of the code snippet on page 153. When the value of those
variables are placed in the code block that follows, this:
FOR counter = 1 TO pulseCount
PULSOUT 13, pulseLeft
PULSOUT 12, pulseRight
PAUSE 20
NEXT
becomes
FOR counter = 1 TO 64
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
Do you recognize the basic maneuver generated by this code block?
Look at the other columns of the code snippet on page 153 and anticipate what
the
FOR…NEXT code block will look like on the second, third, and fourth times
through the loop.
Look at the
LOOP UNTIL (pulseCount = 0) statement in the program below.
The
<> operator stands for "not equal to". What will happen on the fifth time
through the loop?
Enter, save, and run EepromNavigationWithWordValues.bs2.
' Robotics with the Boe-Bot - EepromNavigationWithWordValues.bs2
' Store lists of word values that dictate.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
DEBUG "Program Running!"
' -----[ Variables ]----------------------------------------------------------
counter VAR Word
pulseCount VAR Word ' Stores number of pulses.
addressOffset VAR Byte ' Stores offset from label.
instruction VAR Byte ' Stores EEPROM instruction.
pulseRight VAR Word ' Stores servo pulse widths.

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