28123 Parallax Inc, 28123 Datasheet - Page 136

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
LOOP
How ServoVelocities.bs2 Works
The first
counter
horn’s position rotates counterclockwise by steps that are four times the smallest possible
step.
The second
counter
so the servo horn rotates clockwise.
DEBUG CR, "Pulse width decrement by 20", CR
FOR counter = 1000 TO 500 STEP 20
NEXT
DEBUG CR, "Repeat", CR
PULSOUT 14, counter
PAUSE 7
DEBUG DEC5 counter, CR, CRSRUP
FOR counter = 500 TO 1000 STEP 8
NEXT
FOR counter = 1000 TO 500 STEP 20
variable is also used as an argument for the
FOR…NEXT
variable is used as the
Why
CR, CRSRUP
the 20 ms delay between pulses. A few trial and error experiments showed that
gave the servo the smoothest motion. Your servo may be different.
More
that displays the value of the
decimal format (
carriage return, the formatter
line. This causes the new value of counter to be printed over the old value each time
through the loop.
PULSOUT 14, counter
PAUSE 7
DEBUG DEC5 counter, CR, CRSRUP
PULSOUT 14, counter
FOR…NEXT
PAUSE 7
DEBUG
loop counts upwards from 500 to 1000 in steps of 8. Since the
loop counts downwards from 1000 back to 500 in steps of 20. The
formatters and control characters are featured in the
takes about 8 ms to execute. This means that
DEC5
instead of
). After the value is printed, there is a carriage return (
PULSOUT
CRSRUP
PAUSE 20
counter
(cursor up) sends the cursor back up to the previous
command’s
? The command
variable. This value is printed using the 5-digit
PULSOUT
Duration
DEBUG DEC5 counter,
command in this example,
PAUSE 12
argument, the servo
DEBUG
would maintain
CR
). After the
PAUSE 7
command

Related parts for 28123