28125 Parallax Inc, 28125 Datasheet - Page 89

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
FOR myCounter = 1 TO 10
NEXT
DEBUG CR, "All done!"
END
Your Turn – Different Start and End Values and Counting in Steps
You can use different values for the
Remember the optional
myCounter
13…) or by fives (10, 15, 20…), or whatever
backwards. Here’s an example that uses it to count down in steps of 3:
ACTIVITY #6: TESTING THE SERVOS
There’s one last thing to do before assembling your Boe-Bot, and that’s testing the
servos. In this activity, you will run programs that make the servos turn at different
speeds and directions. By doing this, you will verify that your servos are working
properly before you assemble your Boe-Bot.
DEBUG ? myCounter
PAUSE 500
Modify the
FOR myCounter = 21 TO 9
NEXT
Run the modified program. Did you notice that the BASIC Stamp counted down
instead of up? It will do this whenever the
the
Add
FOR myCounter = 21 TO 9 STEP 3
NEXT
Run the modified program and verify that it counts backwards in steps of 3.
DEBUG ? myCounter
PAUSE 500
DEBUG ? myCounter
PAUSE 500
EndValue
count in steps. Instead of 9, 10, 11…, you can make it count by twos (9, 11,
STEP 3
FOR…NEXT
to the
argument.
{STEP StepValue}
FOR…NEXT
loop so it looks like this:
StartValue
loop so it looks like this:
argument?
and
StepValue
StartValue
EndValue
You can use it to make
you give it, forwards or
arguments.
argument is larger than

Related parts for 28125