Hallo

Zitat Zitat von derfagottist Beitrag anzeigen
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
Denke, daß Du das Rote im Empfängerprogramm ersatzlos streichen kannst. Die do-loop sorgt ja dafür, daß getrc5 immer wieder ausgeführt wird. Wird zu Beginn der for-next Schleife ein RC5 Rahmen erkannt, wird address und command entsprchend belegt. Die Schleife wird aber wieder durchlaufen und liegt kein RC5-Rahmen an wird address und command wieder mit 255 überschrieben und die folgende Auswertung nach der for-next "sieht" keinen Empfang.

Gruß
Searcher