28123 Parallax Inc, 28123 Datasheet - Page 132

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
The
#3 for details. The
They are both used to receive and store values sent from the Debug Terminal. The
pulses
delivers pulses to the servo, and the
PULSOUT
The rest of the program is nested inside a
so that the commands execute over and over again.
The
the number of pulses. Then, the
make up the number and press the Enter key on your keyboard. The digits that you enter
are converted to a value that is stored in the
with a second
variable too.
After you enter the second value, it’s useful to display a message while the servo is
running so that you don’t try to enter a second value:
While the servo is running, you can gently try to move the servo horn away from the
position it is holding. The servo resists light pressure applied to the horn.
counter
DEBUG
variable is also used to set the number of repetitions in the
DO
LOOP
command.
FOR Counter = StartValue TO EndValue {STEP StepValue}…NEXT
This is the
a
itself. There is also an optional
the value of
' Rest of program not shown.
DEBUG CLS, "Enter number of pulses:", CR
DEBUGIN DEC pulses
DEBUG "Enter PULSOUT duration:", CR
DEBUGIN DEC duration
DEBUG "Servo is running...", CR
command is used to send you (the “user” of the software) a message to enter
Counter
variable is declared for use by a
DEBUG
pulses
FOR…NEXT
Counter
,
StartValue
and
and
DEBUGIN
each time through the loop.
loop syntax from the BASIC Stamp Manual. It shows that you need
duration
DEBUGIN
and
duration
StepValue
command that loads a value into the
EndValue
DO…LOOP
variables are used a couple of different ways.
command waits for you to enter digits that
pulses
FOR…NEXT
variable is used to set the duration for the
if you want to add a number other than 1 to
to control how many times the loop repeats
without a
variable. This process is repeated
loop. See Chapter #2, Activity
WHILE
FOR…NEXT
or
UNTIL
duration
argument
loop that

Related parts for 28123