28123 Parallax Inc, 28123 Datasheet - Page 124

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
' What's a Microcontroller - ServoTest.bs2
' Test the servo at three different position signals.
' {$STAMP BS2}
' {$PBASIC 2.5}
counter
DEBUG "Counterclockwise 10 o'clock", CR
FOR counter = 1 TO 150
NEXT
DEBUG "Clockwise 2 o'clock", CR
FOR counter = 1 TO 150
NEXT
DEBUG "Center 12 o'clock", CR
FOR counter = 1 TO 150
NEXT
DEBUG "All done."
END
How ServoTest.bs2 Works
The first
instruct the servo to go to a position that is roughly 10 o’clock if you think about it in
terms of a clock face.
PULSOUT 14, 1000
PAUSE 20
PULSOUT 14, 500
PAUSE 20
PULSOUT 14, 750
PAUSE 20
FOR counter = 1 TO 150
FOR…NEXT
Observe the servo turns at each of the three steps in the program, and record
where the horn is really pointing.
Re-run the program and verify that the LED flickers dimly. It should be
brightest when the BASIC Stamp sends the 10 o’clock signal and dimmest
when the BASIC Stamp sends the 2 o’clock signal. This is because the LED
circuit is only on for half as long (1 out of 21 ms instead of 2 out of 22 ms).
VAR
loop delivers 150 pulses, each of which lasts 2.0 ms. These pulses
Word

Related parts for 28123