HI,
also hier ist mal der Code:
Ich verstehe ihn nicht , weil den mein Vater geschreiben hat.Code:$regfile = "8535def.dat" $crystal = 1000000 Declare Sub Allesaus Config Timer2 = Timer , Prescale = 64 Const Aus = 1 Const An = 0 Config Porta.0 = Output Config Porta.1 = Output Config Porta.2 = Output Config Porta.3 = Output Config Porta.4 = Output Config Porta.5 = Output Config Porta.6 = Output Config Porta.7 = Output Config Portb.0 = Output Config Portd.4 = Output Config Portd.5 = Output Config Portb.3 = Output Led0 Alias Porta.0 Led1 Alias Porta.1 Led2 Alias Porta.2 Led3 Alias Porta.3 Led4 Alias Porta.4 Led5 Alias Porta.5 Led6 Alias Porta.6 Led7 Alias Porta.7 Led8 Alias Portb.0 Rot Alias Portd.4 Blau Alias Portd.5 Gruen Alias Portb.3 Dim Wertr(10) As Integer Dim Wertb(10) As Integer Dim Wertg(10) As Integer Dim I As Integer Dim J As Integer Dim Value As Integer Wertr(1) = 0 Wertg(1) = 0 Wertb(1) = 0 Wertr(2) = 0 Wertg(2) = 0 Wertb(2) = 1 Wertr(3) = 0 Wertg(3) = 0 Wertb(3) = 1 Wertr(4) = 1 Wertg(4) = 0 Wertb(4) = 0 Wertr(5) = 0 Wertg(5) = 0 Wertb(5) = 1 Wertr(6) = 0 Wertg(6) = 0 Wertb(6) = 1 Wertr(7) = 0 Wertg(7) = 0 Wertb(7) = 1 Wertr(8) = 0 Wertg(8) = 0 Wertb(8) = 1 Wertr(9) = 0 Wertg(9) = 0 Wertb(9) = 1 I = 0 On Timer2 Zeitroutine Const Timervorgabe = 12 Enable Timer2 Enable Interrupts Do Loop Zeitroutine: Timer2 = Timervorgabe I = I + 1 If I > 9 Then I = 1 Call Allesaus Waitms 1 If Wertr(i) = 1 Then Rot = An If Wertg(i) = 1 Then Gruen = An If Wertb(i) = 1 Then Blau = An Select Case I Case 1 Led0 = An Case 2 Led1 = An Case 3 Led2 = An Case 4 Led3 = An Case 5 Led4 = An Case 6 Led5 = An Case 7 Led6 = An Case 8 Led7 = An Case 9 Led8 = An End Select Value = Value + 1 If Value > 512 Then For J = 9 To 1 Step -1 Wertr(j + 1) = Wertr(j) Wertg(j + 1) = Wertg(j) Wertb(j + 1) = Wertb(j) Next J Wertr(1) = Wertr(10) Wertg(1) = Wertg(10) Wertb(1) = Wertb(10) Value = 0 End If Return Sub Allesaus: Led0 = Aus Led1 = Aus Led2 = Aus Led3 = Aus Led4 = Aus Led5 = Aus Led6 = Aus Led7 = Aus Led8 = Aus Rot = Aus Blau = Aus Gruen = Aus End Sub
ok und hier sind die Schaltpläne







Zitieren

Lesezeichen