Dienstag, 7. Januar 2014

Led Matrix 8x5 with Shift register and Shiftout




The Bascom code



Dim S As String * 8
Dim U As String * 8
Dim L(6) As Byte
Dim A As Long
Dim B As Byte
Dim C As Byte
Config Portb = Output
Config Portc = Output

Clock Alias Portb.1
Outdata Alias Portb.2
Latch Alias Portb.3
Srreset Alias Portb.0

Srreset = 0
Srreset = 1

L(1) = &B0010000
L(2) = &B0111110
L(3) = &B1111110
L(4) = &B0111110
L(5) = &B0010000


Do

For A = 1 To 7
Portc = 1
For B = 1 To 5

Shiftout Outdata , Clock , L(b) , 2 , 8

Latch = 1
Latch = 0
Srreset = 0
Srreset = 1
Waitms 20
Latch = 1
Latch = 0
Rotate Portc , Left
Next B

Next A
For C = 1 To 5
Rotate L(c) , Left
Next C
Loop

End


Keine Kommentare:

Kommentar veröffentlichen