Hi
du musst die Variablen Modus und AnzahlModi auch definieren.
Code:$regfile = "attiny13.dat" $crystal = 1200000 $hwstack = 0 $swstack = 0 $framesize = 0 Config Portb.1 = Output Config Portb.2 = Output Config Portb.3 = Output Config Portb.4 = Output Config Pinb.0 = Input Dim Modus As Integer Dim Anzahlmodi As Integer Modus = 1 Anzahlmodi = 2 do If Pinb.0 = 1 Then Incr Modus If Modus > AnzahlModi then Modus=1 Select Case Modus Case 1 Gosub Lichteffekt1 Case 2 Gosub Lichteffekt2 end select loop end Lichteffekt1: Portb.1 = 1 Portb.2 = 0 Portb.3 = 1 Portb.4 = 0 Waitms 100 Portb.3 = 0 Portb.4 = 1 Waitms 100 Portb.3 = 1 Portb.4 = 0 Waitms 100 Portb.1 = 0 Portb.2 = 1 Portb.3 = 0 Portb.4 = 1 Waitms 100 Portb.3 = 1 Portb.4 = 0 Waitms 100 Portb.3 = 0 Portb.4 = 1 Waitms 100 Return Lichteffekt2: Portb.1 = 1 Portb.2 = 1 Portb.3 = 1 Portb.4 = 1 Waitms 100 Portb.1 = 0 Portb.2 = 0 Portb.3 = 0 Portb.4 = 0 Waitms 100 Return
Lesezeichen