Hallo
Ich habe einen Attiny13 programmiert mit folgendem Programm.
Nun meine frage ich will an port 0 nun eine 30W 6V Birne anschlichen (mit einer 5V LED klappt es)aber ich weis nicht wie. Kann mir jemand helfenCode:$regfile = "ATtiny13.dat" $crystal = 1200000 $hwstack = 32 $swstack = 9 $framesize = 20 Config Portb.0 = Output Config Portb.1 = Input Config Timer0 = Pwm , Prescale = 8 , Compare A Pwm = Clear Down Portb.1 = 1 Dim I As Byte 'I als Variable für den Zustand I = 0 Config Int0 = Falling On Int0 Int0_isr Enable Int0 Enable Interrupts Do Select Case I Case 0 : Gosub Aus Case 1 : Gosub Stufe1 Case 2 : Gosub Stufe2 Case 3 : Gosub Stufe3 End Select Loop End Aus: Pwm0a = 0 Return Stufe1: Pwm0a = 255 Waitms 400 Return Stufe2: Pwm0a = 100 Waitms 400 Return Stufe3: Pwm0a = 25 Waitms 400 Return Int0_isr: Incr I If I > 3 Then I = 0 Return
Gruß Robert22







Zitieren
Lesezeichen