28123 Parallax Inc, 28123 Datasheet - Page 131

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 - ServoControlWithDebug.bs2
' Send messages to the BASIC Stamp to control a servo using
' the Debug Terminal.
' {$STAMP BS2}
' {$PBASIC 2.5}
counter
pulses
duration
DO
LOOP
How ServoControlWithDebug.bs2 Works
Three
DEBUG CLS, "Enter number of pulses:", CR
DEBUGIN DEC pulses
DEBUG "Enter PULSOUT duration:", CR
DEBUGIN DEC duration
DEBUG "Servo is running...", CR
FOR counter = 1 TO pulses
NEXT
DEBUG "DONE"
PAUSE 1000
PULSOUT 14, duration
PAUSE 20
Word
counter
pulses
duration
Experiment with entering other values between 500 and 1000 for the
Duration
It takes between 40 and 45 pulses to make the servo hold a position for 1 second.
variables are declared in this program:
Var
Var
Var
and values between 1 and 65534 for the number of pulses.
Word
Word
Word
Var
Var
Var
WORD
WORD
WORD
PULSOUT

Related parts for 28123