27220 Parallax Inc, 27220 Datasheet - Page 51

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Program: SW21-EX05-LED_Graph.BS2:
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Program Description ]---------------------------------------------
'
' Displays a linear (bar) or dot graph using eight LEDs.
' will require modifications (to the constants LoScale and HiScale) when
' running on the BS2Sx, BS2p, or BS2px.
' -----[ I/O Definitions ]-------------------------------------------------
LEDs
LEDsDirs
Pot
' -----[ Constants ]-------------------------------------------------------
DotGraf
BarGraf
GraphMode
IsOn
IsOff
LoScale
HiScale
Span
Scale
' -----[ Variables ]-------------------------------------------------------
rawVal
grafVal
hiBit
newBar
4. Using white wire, connect socket B16 to the wiper (center terminal) of the
5. Using black wire, connect the Vss (ground) rail to the bottom terminal of the
10K potentiometer.
10K potentiometer.
VAR
VAR
PIN
CON
CON
CON
CON
CON
CON
CON
CON
CON
VAR
VAR
VAR
VAR
OUTL
DIRL
15
0
1
BarGraf
1
0
10
695
HiScale - LoScale
$FFFF / Span
Word
Byte
Byte
Byte
' LEDs on P0 - P7
' DIRS control for LEDs
' Pot circuit IO
' define graph types
' define graph mode
' raw low reading
' raw high reading
' between lo-to-hi
' scale factor 0..255
' raw value from pot
' graph value
' highest lighted bit
' workspace for bar graph
This program

Related parts for 27220