ok ich habs noch mal mit zwei Schaltern und gosub gemacht...



Code:
$regfile = "m32def.dat"
$framesize = 32
$swstack = 32
$hwstack = 32
$crystal = 16000000

Config Portd.7 = Output
Config Portc.1 = Output
Config Portc.0 = Output
Config Pind.0 = Input
Config Pind.1 = Input

Taster Alias Pind.0
Taster2 Alias Pind.1
Rot Alias Portd.7
Gelb Alias Portc.1
Gruen Alias Portc.0

Portd.0 = 1
Portd.1 = 1
Rot = 1
Gelb = 1
Gruen = 1

Do
If Taster = 0 Then Gosub Led_lauf


If Taster2 = 0 Then Gosub Blinken
Loop

Blinken:
Rot = 0
Gelb = 0
Gruen = 0
Waitms 500
Rot = 1
Gelb = 1
Gruen = 1
Waitms 500
Return


Led_lauf:
  Rot = 0
  Waitms 50
  Rot = 1
  Waitms 50

  Gelb = 0
  Waitms 50
  Gelb = 1
  Waitms 50

  Gruen = 0
  Waitms 50
  Gruen = 1
  Waitms 50

  Gelb = 0
  Waitms 50
  Gelb = 1
  Waitms 50
Return


End