'IR Empfänger mit einem ATtiny25 $regfile = "attiny25.dat" $crystal = 1200000 $hwstack = 32 $swstack = 10 $framesize = 12 Config Timer1 = Pwm , Prescale = 1 , Compare B Pwm = Clear Down Enable Interrupts Config Rc5 = Portb.2 Config Portb.4 = Output Config Portb.3 = Output Tccr1 = &B00000001 Gtccr = &B01100000 Dim Adresse As Byte , Comando As Byte Dim Helligkeit As Byte Dim Speicher As Byte Dim Anaus As Bit Anaus = 0 Portb.3 = 1 Waitms 100 Portb.3 = 0 Do Getrc5(adresse , Comando) If Adresse = 11 Then Comando = Comando And &B01111111 If Comando = 8 Then If Anaus = 0 Then Anaus = 1 Portb.3 = 1 Readeeprom Speicher , &H01 Speicher = Speicher - 1 For Helligkeit = 0 To Speicher Step 1 Ocr1b = Helligkeit Waitms 6 Next Helligkeit Else Anaus = 0 Portb.3 = 0 Speicher = Helligkeit Writeeeprom Speicher , &H01 For Helligkeit = Speicher To 1 Step -1 Ocr1b = Helligkeit Waitms 6 Next Helligkeit Ocr1b = 0 End If Waitms 100 End If If Anaus = 1 Then If Comando = 2 Then If Helligkeit <= 240 Then Helligkeit = Helligkeit + 15 End If Waitms 20 Elseif Comando = 4 Then If Helligkeit > 30 Then Helligkeit = Helligkeit - 15 End If Waitms 20 End If End If End If Ocr1b = Helligkeit Loop End