28123 Parallax Inc, 28123 Datasheet - Page 278

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
Imagine next that you turn the potentiometer all the way clockwise. That’s the same as
sending a high signal to the AD5220’s U/D pin and sending 65 pulses to the CLK pin.
Now the LED should be shining brightly.
Finally, imagine that you turn your manual potentiometer all the way counterclockwise.
The LED should emit no light. That’s the same as sending a low signal to the U/D pin,
and applying 128 pulses to the CLK pin
Example Program: DigitalPotUpDown.bs2
This example program adjusts the potentiometer up and down, from one end of its range
to the other, causing the LED to get gradually brighter, then gradually dimmer.
' What's a Microcontroller - DigitalPotUpDown.bs2
' Sweep digital pot through values.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
counter
DO
LOW 5
FOR counter = 0 TO 127
NEXT
HIGH 5
PULSOUT 6, 1
PAUSE 10
HIGH 5
FOR counter = 1 TO 65
NEXT
LOW 5
FOR counter = 0 TO 127
NEXT
Enter and run DigitalPotUpDown.bs2.
PULSOUT 6, 1
PAUSE 1
PULSOUT 6, 1
PAUSE 1
VAR
Byte

Related parts for 28123