Code:
Config Rc5 = Pinb.1 'Rc5 konfigurieren
Enable Interrupts 'Interrupts erlauben
Config Portd = Output 'Konfiguration der
Config Pinc.0 = Input 'Out- und
Config Pinc.1 = Input 'der Inputports
Config Pinc.2 = Input 'Dito
Config Pinc.3 = Input 'Dito
Config Pinc.4 = Input 'Dito
Config Pinc.5 = Input 'Dito
Portd = 0 'Ausschalten von
'PortD
Dim Address As Byte 'Variablen
Dim Command As Byte 'dimensionieren
Dim I As Long 'Dito
I = 0 'Variablen setzen
Address = 0 'Dito
Command = 0 'Dito
Main: 'Hauptprogramm
Do
Portd = 1
For I = 1 To 100
Getrc5(address , Command) 'Auf Rc5 Signal warten
Next I
If Address < 255 Then
Command = Command And &B10111111 'Lösche Toggle-Bit
Portd = 2
Waitms 100
If Address = 17 And Command = 16 Then
Portd = 4
Waitms 100
Else
Portd = 2
Waitms 100
End If
'Waitms 10
Else
Portd = 8
Waitms 100
End If
Loop
End
Lesezeichen