$regfile = "attiny45.dat" $crystal = 1000000 Config Timer0 = Pwm , Prescale = 1 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down Gtccr = &B01110000 Tccr1 = &B01110001 Ddrb = &B00010011 Config Pinb.2 = Input Pinb.2 = 1 Dim Blau As Word Dim Gruen As Word Dim Rot As Word Dim Zeit As Word Dim Zeit2 As Word Zeit2 = 100 Dim Zeit3 As Word Dim I As Byte I = 2 Pwm0a = 255 Pwm0b = 255 Ocr1b = 0 Wait 1 Pwm0a = 0 Pwm0b = 255 Ocr1b = 255 Wait 1 Pwm0a = 255 Pwm0b = 0 Ocr1b = 255 Wait 1 Do Incr Zeit If Pinb.2 = 0 And Zeit > 150 Then Zeit2 = Zeit / 6 Zeit3 = Zeit2 Zeit = 0 I = 1 End If If Zeit2 > 0 Then Decr Zeit2 If Zeit2 > 0 Then Select Case I Case 1 : Pwm0a = 255 Pwm0b = 0 Ocr1b = 255 Case 2 : Pwm0a = 255 Pwm0b = 255 Ocr1b = 0 Case 3 : Pwm0a = 0 Pwm0b = 255 Ocr1b = 255 Case 4 : Pwm0a = 255 Pwm0b = 0 Ocr1b = 255 Case 5 : Pwm0a = 255 Pwm0b = 255 Ocr1b = 0 Case 6 : Pwm0a = 0 Pwm0b = 255 Ocr1b = 255 Case Else : Pwm0a = 255 Pwm0b = 255 Ocr1b = 255 End Select Else Pwm0a = 255 Pwm0b = 255 Ocr1b = 255 End If If Zeit2 = 0 Then Zeit2 = Zeit3 Incr I If I = 7 Then I = 1 End If Waitms 1 Loop End