27297 Parallax Inc, 27297 Datasheet - Page 51

KIT STAMPWORKS WITH BS2-IC

27297

Manufacturer Part Number
27297
Description
KIT STAMPWORKS WITH BS2-IC
Manufacturer
Parallax Inc
Datasheet

Specifications of 27297

Lead Free Status
Contains lead
Product
Microcontroller Accessories
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
27297SQ
Manufacturer:
NS
Quantity:
4
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 27297