27220 Parallax Inc, 27220 Datasheet - Page 79

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
Digit8
Digit9
DigSel
' -----[ Initialization ]--------------------------------------------------
Reset:
' -----[ Program Code ]----------------------------------------------------
Main:
' -----[ Subroutines ]-----------------------------------------------------
Show_Clock:
Behind the Scenes
The first two projects with 7-segment displays used only one digit. This project uses
four. A new problem arises; since the segment (anode) lines of the displays are tied
together, we can only activate one at a time. This is accomplished by putting the
Digs = %1111
DIRS = $0FFF
DO WHILE (Tic = IsHigh)
LOOP
DO WHILE (Tic = IsLow)
LOOP
secs = secs + 1 // 3600
GOTO Main
time = (secs / 60) * 100
time = time + (secs // 60)
Segs = Blank
READ (DigSel + theDig), Digs
READ (Digit0 + (time DIG theDig)), Segs
IF (theDig = 2) THEN
ENDIF
theDig = theDig + 1 // 4
RETURN
GOSUB Show_Clock
GOSUB Show_Clock
Segs = Segs | DecPnt
DATA
DATA
DATA
DATA
DATA
DATA
%01111111
%01100111
%1110
%1101
%1011
%0111
' digit 0 active
' digit 1 active
' digit 2 active
' digit 3 active
' all off
' make segs & digs outputs
' wait during high cycle
' wait during low cycle
' update current time
' get mins, move to 100s
' add seconds in 1s/10s
' clear display
' select digit
' move digit pattern to segs
' add decimal point
' update digit pointer

Related parts for 27220