'Das Programm schaltet 3 Relais über entsprechende PNP- Transistoren 'by Paul Baumann 06/2004 '------------------------------------------------------------------- $regfile = "2313def.dat" 'Quarz: 4 MHz $crystal = 4000000 Ddrd = &B11111110 : Portd = 255 Ddrb = &B00000101 : Portb = 255 $lib "mcsbyte.lbx" 'an Pind.0 sitzt der Infrarotempfänger Config Rc5 = Pind.0 'Interrupts erlauben Enable Interrupts Dim Address As Byte , Command As Byte Do Getrc5(address , Command) 'Nur auf Adresse 0 reagieren (Code für TV-Geräte) If Address = 0 Then 'Toggle Bit jedesmal löschen Command = Command And &B10111111 Select Case Command Case 1 : Portb.0 = 0 'Taste 1 schaltet rote LED ein Case 2 : Portb.0 = 1 'Taste 2 schaltet rote LED aus Case 3 : Portd.6 = 0 'gelbe Led ein Case 4 : Portd.6 = 1 'gelbe Led aus Case 5 : Portb.2 = 0 'grüne Led ein Case 6 : Portb.2 = 1 'grüne Led aus End Select If Command = 0 Then 'Taste Null schaltet alle aus Portb.0 = 1 Portd.6 = 1 Portb.2 = 1 End If End If Loop End