Kaum schreibst du das, sehe ich, dass das natürlich nicht richtig ist. Probier es mal so:Shiftout Dataout , Clockout , Block1(zeile ) , 0 , 16
Shiftout Dataout , Clockout , Block4(zeile ) , 0 , Scroll_position
Shiftout Dataout , Clockout , Block2(zeile ) , 0 , 16
Shiftout Dataout , Clockout , Block5(zeile ) , 0 , Scroll_position
Shiftout Dataout , Clockout , Block3(zeile ) , 0 , 16
Shiftout Dataout , Clockout , Block6(zeile ) , 0 , Scroll_position
Code:
'*******************************************************************************
' LED Matix Uhr
'*******************************************************************************
' µC Deklarationen +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$regfile = "m32def.dat"
$crystal = 16000000
$hwstack = 32
$swstack = 30
$framesize = 40
' Ein-/Ausgänge ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Config Porta = Output
Config Portb = Output
Config Portd.5 = Output '<-- für PWM
Dataout Alias Portb.2
Strobeout Alias Portb.1
Clockout Alias Portb.0
Enableout Alias Portd.5 '<-- für PWM
'Zeile Alias Porta
' Timer und Config +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' Variablen ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dim Helligkeitswert As Long
Dim Block1(8) As Word
Dim Block2(8) As Word
Dim Block3(8) As Word
Dim Block4(8) As Word
Dim Block5(8) As Word
Dim Block6(8) As Word
Dim Zeile As Byte
Dim Out_str As String * 16
Dim Out_ovly(16) As Byte At Out_str Overlay
Dim Buchstabe As Byte
Dim Offset As Byte
Dim Temp As Byte
Dim Block1_w As Word
Dim Block2_w As Word
Dim Block3_w As Word
Dim Block4_w As Word
Dim Block1_l_b As Byte At Block1_w Overlay
Dim Block1_h_b As Byte At Block1_w + 1 Overlay
Dim Block2_l_b As Byte At Block2_w Overlay
Dim Block2_h_b As Byte At Block2_w + 1 Overlay
Dim Block3_l_b As Byte At Block3_w Overlay
Dim Block3_h_b As Byte At Block3_w + 1 Overlay
Dim Block1_2_long As Long At Block1_w Overlay
Dim Block2_3_long As Long At Block2_w Overlay
Dim Scroll_counter As Word
Dim Scroll_position As Byte , Scroll_tmp As Byte
'(
- - - -block1 - - - - -block2 - - - - - -block3 - - - - - -block4 - - - - -block5 - - - - - -block6 - -
7. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
6. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
5. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
4. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
3. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
2. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
1. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
0. 54321098_76543210 54321098_76543210 54321098_76543210 5432109876543210 5432109876543210 5432109876543210
11111122_22223333 33444444_55555566 66667777_77888888 1111112222223333 3344444455555566 6666777777888888
Blck_3_l_blck_3_h Blck_2_l_blck_2_h Blck_1_l_blck_1_h
76543210_76543210 76543210_76543210 76543210_76543210
011100
011100
0111 00100001
')
' Werte ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Out_str = "ABCDEFGH"
'*******************************************************************************
' Hauptschleife
'*******************************************************************************
'Config Base = 0
For Zeile = 6 To 0 Step -1
For Buchstabe = 0 To 7
If Buchstabe = 5 Then
Shift Block3_w , Left , 6
Elseif Buchstabe = 6 Then
Shift Block3_w , Left , 4
End If
Shift Block1_2_long , Left , 6
Offset = Out_ovly(buchstabe) - 65 'A ist der erste Buchstabe, also 0
Offset = Offset * 7
Offset = Offset + Zeile
Temp = Lookup(offset , My_data)
Block1_l_b = Block1_l_b + Temp 'dies überschreibt nur die unteren 6 Bit
If Buchstabe = 7 Then Exit For
Temp = Block2_h_b
If Buchstabe = 6 Then
Shift Temp , Right , 2
Temp = Temp And &B00001111
Block3_l_b = Block3_l_b + Temp
Else
Block3_l_b = Temp
End If
Next Buchstabe
Incr Offset
Block1(zeile ) = Block3_w
Block2(zeile ) = Block2_w
Block3(zeile ) = Block1_w
Block4(zeile ) = Block3_w 'eingescrollter Text ist der gleiche wieder
Block5(zeile ) = Block2_w
Block6(zeile ) = Block1_w
Print Bin(block1(zeile )) ; " " ; Bin(block2(zeile )) ; " " ; Bin(block3(zeile ))
Next Zeile
Config Timer0 = Timer , Prescale = 64
On Timer0 Timer_0
Enable Timer0
Start Timer0
Enable Interrupts
Do
If Scroll_counter = 200 Then 'alle 0,2sec rückt der Text weiter
Scroll_counter = 0
Incr Scroll_position
If Scroll_position = 49 Then
Scroll_position = 0
Scroll_counter = 60000 'sorgt für etwa 5 sec Pause
End If
End If
Loop
End
'*******************************************************************************
' Timer0 --> Anzeige Prozess
'*******************************************************************************
Timer_0:
Incr Scroll_counter
Porta.zeile = 1 'schaltet die vorherige Zeile aus
Incr Zeile
If Zeile = 8 Then Zeile = 0
Strobeout = 0
Shiftout Dataout , Clockout , Block1(zeile ) , 0 , 16
Shiftout Dataout , Clockout , Block2(zeile) , 0 , 16
Shiftout Dataout , Clockout , Block3(zeile ) , 0 , 16
If Scroll_position < 17 Then
Shiftout Dataout , Clockout , Block4(zeile ) , 0 , Scroll_position
Else
Shiftout Dataout , Clockout , Block4(zeile ) , 0 , 16
If Scroll_position < 33 Then
Scroll_tmp = Scroll_position - 16
Shiftout Dataout , Clockout , Block5(zeile ) , 0 , Scroll_tmp
Else
Shiftout Dataout , Clockout , Block5(zeile ) , 0 , 16
Scroll_tmp = Scroll_position - 32
Shiftout Dataout , Clockout , Block6(zeile ) , 0 , Scroll_tmp
End If
End If
Strobeout = 1
Porta.zeile = 0 'schaltet die neue Zeile ein
Return
'*******************************************************************************
' Zeichen Tabelle
'*******************************************************************************
$data
My_data:
Data &B001000 , &B010100 , &B100010 , &B100010 , &B111110 , &B100010 , &B100010 'A
Data &B111100 , &B100010 , &B100010 , &B111100 , &B100010 , &B100010 , &B111100 'B
Data &B011100 , &B100010 , &B100000 , &B100000 , &B100000 , &B100010 , &B011100 'C
Data &B111100 , &B100010 , &B100010 , &B100010 , &B100010 , &B100010 , &B111100 'D
Data &B111110 , &B100000 , &B100000 , &B111110 , &B100000 , &B100000 , &B111110 'E
Data &B111110 , &B100000 , &B100000 , &B111110 , &B100000 , &B100000 , &B100000 'F
Data &B011110 , &B100000 , &B100000 , &B101110 , &B100010 , &B100010 , &B011100 'G
Data &B100010 , &B100010 , &B100010 , &B111110 , &B100010 , &B100010 , &B100010 'H
Data &B011100 , &B001000 , &B001000 , &B001000 , &B001000 , &B001000 , &B011100 'I
Data &B000010 , &B000010 , &B000010 , &B000010 , &B100010 , &B100010 , &B011100 'J
Data &B001000 , &B010100 , &B100010 , &B000010 , &B111110 , &B100010 , &B100010 '
Data &B001000 , &B010100 , &B100010 , &B000010 , &B111110 , &B100010 , &B100010 '
Data &B001000 , &B010100 , &B100010 , &B000010 , &B111110 , &B100010 , &B100010 '
Data &B100010 , &B110010 , &B101010 , &B100110 , &B100010 , &B100010 , &B100010 'N
HBA