28125 Parallax Inc, 28125 Datasheet - Page 88
28125
Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet
1.28125.pdf
(360 pages)
Specifications of 28125
Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
- Current page: 88 of 360
- Download datasheet (5Mb)
Counting and Controlling Repetitions
The most convenient way to control the number of times a piece of code is executed is
with a
The three-dots
and
The
you see something between curly braces { } in a syntax description, it means it’s an
optional argument. In other words, the
use it for a special purpose.
You don’t have to name the variable “counter”.
“myCounter”.
Here’s an example of a
also displays the value of the
Example Program: CountToTen.bs2
' Robotics with the Boe-Bot – CountToTen.bs2
' Use a variable in a FOR...NEXT loop.
' {$STAMP BS2}
' {$PBASIC 2.5}
myCounter
√
NEXT
√
StartValue
FOR…NEXT
value = value - anotherValue
DEBUG "value = ", SDEC value, CR ' Display values again
Run the modified program and verify that
FOR Counter = StartValue TO EndValue {STEP StepValue}…NEXT
myCounter
FOR myCounter = 1 TO 10
NEXT
Enter, save, and run CountToTen.bs2.
statements. Make sure to declare a variable for use in the
DEBUG ? myCounter
PAUSE 500
...
loop. Here is the syntax:
and
indicate that you can put one or more commands between the
VAR
EndValue
FOR…NEXT
VAR
myCounter
Word
arguments can be either numbers or variables. When
loop that uses the
Word
FOR…NEXT
variable each time through the loop.
' Answer = -1500
value
loop will work without it, but you can
myCounter
For example, you can call it
changes from 500 to -1500.
variable for counting. It
Counter
argument.
FOR
Related parts for 28125
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: