Moin Andree-HB
Ich habe mir was zurecht gebastelt mit einen ( ATtiny2313 ) Später ATtiny13 werden
Hier mein Code, irgendwie kommt und passiert nichts ähm....
Code:$regfile = "attiny2313.dat" $crystal = 8000000 $hwstack = 40 $swstack = 16 $framesize = 32 Dim Pwmval As Byte Config Portb.1 = Output Config Portb.0 = Input Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Prescale = 1 Portb.0 = 1 Compare1a = 255 Pwmval = 50 Do If Pinb.0 = 0 Then If Pwmval < 255 Then Incr Pwmval Waitms 50 : Compare1a = Pwmval End If If Pinb.0 = 0 Then If Pwmval < 180 Then Incr Pwmval Waitms 50 : Compare1a = Pwmval End If If Pinb.0 = 0 Then If Pwmval < 100 Then Incr Pwmval Waitms 50 : Compare1a = Pwmval End If If Pinb.0 = 0 Then If Pwmval > 50 Then Decr Pwmval Waitms 50 : Compare1a = Pwmval End If Loop







Zitieren

Lesezeichen