' Verwendete CPU (ATmega festlegen
$regfile = "m8def.dat"

' Taktfrequenz einstellen (1MHz)
$crystal = 1000000


' Pin's an Port C als Ausgang festlegen (Pin's der LED's)
Config Portc.0 = Output
Config Portc.1 = Output
Config Portc.2 = Output

' Pin an Port D2 als Eingang festlegen (Pin des linken Taster)
Config Pind.2 = Input

Config Int1 = Falling
' generell Interrupts zulassen


' Variable (Speed = 1s) als Ganzzahl festlegen
Dim Speed As Integer
Speed = 1000


Enable Interrupts
Enable Int1
' Zu Unterprogramm springen
On Int1 Beenden





' Hauptschleife
Do
If Pind.2 = 1 Then
' Programmschleife
Do

Portc.0 = 1
Waitms Speed
Portc.0 = 0
Portc.1 = 1
Waitms Speed
Portc.1 = 0
Portc.2 = 1
Waitms Speed
Portc.2 = 0

Loop
End If
Loop

' Unterprogramm
Beenden:
Portc.0 = 0
Portc.1 = 0
Portc.2 = 0
Return

End

Wir das Funktionieren?