28123 Parallax Inc, 28123 Datasheet - Page 192

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
END
Example Program: DialDisplay.bs2
This example program mirrors the position of the potentiometer’s knob by lighting
segments around the outside of the 7-segment LED display as shown in Figure 6-16.
' What's a Microcontroller - DialDisplay.bs2
' Display POT position using 7-segment LED display.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program Running!"
index
time
OUTH = %00000000
DIRH = %11111111
DO
HIGH 5
PAUSE 100
RCTIME 5, 1, time
LOOKDOWN time, <= [40, 150, 275, 400, 550, 800], index
"LOOKDOWN command places in the ", CR,
"index variable."
Enter and run DialDisplay.bs2.
Twist the potentiometer’s input shaft and make sure it works.
When you run the example program, it may not be as precise as shown in
Figure 6-16. Adjust the values in the lookdown table so that that the digital
display more accurately depicts the position of the potentiometer.
VAR
VAR
Nib
Word
Figure 6-16
Displaying the
Potentiometer’s
Position with the
7-Segment LED
Display

Related parts for 28123