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 #135 background imageLoading...
Page #135 background image
Chapter 3: Assemble and Test Your Boe-Bot · Page 121
FREQOUT 4, 2000, 3000 ' Signal start of program.
FOR counter = 1 TO 122 ' Clockwise just under 3 seconds.
PULSOUT 12, 650
PAUSE 20
NEXT
FOR counter = 1 TO 40 ' Stop one second.
PULSOUT 12, 750
PAUSE 20
NEXT
FOR counter = 1 TO 122 ' Counterclockwise three seconds.
PULSOUT 12, 850
PAUSE 20
NEXT
FREQOUT 4, 500, 3500 ' Signal end of program
END
P2. To solve this problem, TestServoSpeed.bs2 must be expanded to receive three
pieces of data: left servo pulsewidth, right servo pulsewidth, and number of
pulses. Then, a
FOR…NEXT loop with two servo PULSOUT commands must be
added to actually move the servo motors. Furthermore, all variables must be
declared in the beginning of the program. An example solution is shown below.
' Robotics with the Boe-Bot - Ch03Prj02_DebuginMotion.bs2
' Enter servo pulsewidth & duration for both wheels via Debug Terminal.
'{$STAMP BS2}
'{$PBASIC 2.5}
ltPulseWidth VAR Word ' Left servo pulse width
rtPulseWidth VAR Word ' Right servo pulse width
pulseCount VAR Byte ' Number of pulses to servo
counter VAR Word ' Loop counter
DO
DEBUG "Enter left servo pulse width: " ' Enter values in Debug
DEBUGIN DEC ltPulseWidth ' Terminal
DEBUG "Enter right servo pulse width: "
DEBUGIN DEC rtPulseWidth
DEBUG "Enter number of pulses: "
DEBUGIN DEC pulseCount
FOR counter = 1 TO pulseCount ' Send specific number of pulses

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