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 #128 background imageLoading...
Page #128 background image
Page 114 · Robotics with the Boe-Bot
FOR counter = 1 TO 244
PULSOUT 12, pulseWidth
PULSOUT 13, pulseWidthComp
PAUSE 20
NEXT
LOOP
How TestServoSpeed.bs2 Works
Three variables are declared, counter for the FOR…NEXT loop, pulseWidth for the
DEBUGIN and PULSOUT commands, and pulseWidthComp which stores a value that is
used in a second
PULSOUT command.
counter VAR Word
pulseWidth VAR Word
pulseWidthComp VAR Word
The FREQOUT command is used to signal that the program has started.
FREQOUT 4,2000,3000
The remainder of the program is nested within a DO…LOOP, so it will execute over and
over again. The Debug Terminal’s operator (that's you) is asked to enter a pulse width.
The
DEBUGIN command stores this value in the pulseWidth variable.
DEBUG "Enter pulse width: "
DEBUGIN DEC pulseWidth
To make the measurement more accurate, two PULSOUT commands have to be sent. By
making one
PULSOUT command the same amount below 750 as the other is above 750,
the sum of the two
PULSOUT Duration arguments is always 1500. That ensures that the
two
PULSOUT commands combined take the same amount of time. The result is that no
matter the
Duration of your PULSOUT command, the FOR…NEXT loop will still take the
same amount of time to execute. This will make the
RPM measurements you will take in
the Your Turn section more accurate.
This next command takes the pulse width you entered, and calculates a pulse width that
will make 1500 when the two are added together. If you enter a pulse width of 650,
pulseWidthComp will be 850. If you enter a pulse width of 850, pulseWidthComp will

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