Hi,
meine Taster liegen auf Portb, die Leds auf PortC, als Controller werkelt ein AT90CAN128.
Kannst du ja bei dir entsprechend anpassen.
Ist das in etwa das, was du machen möchtest ?
Code:
$regfile = "m128can.dat"
$crystal = 16000000
Config Portc = Output
Config Portb = Input
Portb = &HFF
Taste_1 Alias Pinb.0
Taste_2 Alias Pinb.1
Taste_3 Alias Pinb.2
Taste_4 Alias Pinb.3
Taste_5 Alias Pinb.4
Taste_6 Alias Pinb.5
Taste_7 Alias Pinb.6
Taste_8 Alias Pinb.7
Led_1 Alias Portc.0
Led_2 Alias Portc.1
Led_3 Alias Portc.2
Led_4 Alias Portc.3
Led_5 Alias Portc.4
Led_6 Alias Portc.5
Led_7 Alias Portc.6
Led_8 Alias Portc.7
Dim N As Byte
Portc = 0
Do
Led_1 = Taste_1
Led_2 = Not Taste_2
While Taste_3 = 0
For N = 0 To 7
Portc = 2 ^ N
Waitms 100
If Taste_3 = 1 Then
Portc = 0
Exit For
End If
Next N
Wend
If Taste_4 = 0 Then
Toggle Led_5
While Taste_4 = 0 : Wend
End If
Loop
End
Gruß
Christopher
Lesezeichen