Fernbedienungs Tester

Gast #1103983
Lesenswert?

Hallo,


Soll als Projekt Arbeit einen Fernbedienungsterster bauen mit dem der 
Code auch gleichzeitig ausgelesen und über ein USB oder RS232 Kabel an 
ein selbst geschriebenes Programm in Visual Basic geschickt wird. Das 
Programm soll auch den ausgelesenen Code wieder senden können um damin 
zum Beispiel ein TV zu steuern. Als Vorgabe habe ich einen AVR 8, die IR 
Diode SFH5110-36 und das Programm Bascom.
Der Prüfer hat mir auch folgenden Code per E-Mail geschickt ist dieser 
komplett oder fehlen da noch Befehle?


$regfile = "m8def.dat"                  'zu jedem Modell passende Datei
$crystal = 8000000                      'Quarz (Resonator) Frequenz
$PROG &HFF,&HAE,&HD9,&H00    'FuseBit auf Extern. Quarz
$baud = 9600                        'gewünschte Baudrate vorgeben
Config Rc5 = Pind.5               'an PD5 ist die IR-Diode angeschl.
Enable Interrupts
Print "Waiting for RC5..."
Dim Address As Byte , Command As Byte
Print "Waiting for RC5..."
'If the pins is used for other input just unremark the next line
'Config Pind.2 = Input
  Getrc5(Address , Command)
  'we check for the TV address and that is 0
Do
  'now check if a key on the remote is pressed
  'Note that at startup all pins are set for INPUT
  'so we dont set the direction here
  'If the pins is used for other input just unremark the next line
 'Config Pind.2 = Input
  Getrc5(Address , Command)
  'we check for the TV address and that is 0
  If Address = 0 Then
     'clear the toggle bit
     'the toggle bit toggles on each new received command
     'toggle bit is bit 7. Extended RC5 bit is in bit 6
     Command = Command And &B01111111
     Print Address ; "  " ; Command
  End If
Loop
End


Bitte um schnelle Hilfe mein AVR Aufbau im Anhang

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren