so...dieser code hier sollte jetzt funktionieren. du kannst zum testen einfach mal statt "'code für lichter" z.B. "print "laufa"" einsetzen, um fehler bei der verkabelung der leds auszuschließen.
das lauflicht deiner wahl läuft mit diesem code hier so lange, bis du ein anders auswählst.

Code:
$regfile = "m8def.dat"
$crystal = 1000000

'###Declarationen###
Config Portc = Output
Config Portd = Input
Portd = 1

Led1 Alias Portc.5
Led2 Alias Portc.4
Led3 Alias Portc.3
Led4 Alias Portc.2
Led5 Alias Portc.1
Led6 Alias Portc.0

'###Hauptschleife###

Do
If Pind.0 = 0 Then
Gosub Laufa
End If
If Pind.1 = 0 Then
Gosub Laufb
End If
If Pind.2 = 0 Then
Gosub Laufc
End If
Loop

'###Lauflichter###
Laufa:

'code für lichter


If Pind.0 = 0 Then
Gosub Laufa
End If
If Pind.1 = 0 Then
Gosub Laufb
End If
If Pind.2 = 0 Then
Gosub Laufc
End If
Goto Laufa


'----------

Laufb:

'code für lichter


If Pind.0 = 0 Then
Gosub Laufa
End If
If Pind.1 = 0 Then
Gosub Laufb
End If
If Pind.2 = 0 Then
Gosub Laufc
End If
Goto Laufb

'----------

Laufc:

'code für lichter


If Pind.0 = 0 Then
Gosub Laufa
End If
If Pind.1 = 0 Then
Gosub Laufb
End If
If Pind.2 = 0 Then
Gosub Laufc
End If
Goto Laufc
mfg Markus