ich habe das Programm nochmal geändert jetzt funtzt es auch mit verstellung ich habe nur immer wenn ich einen taster betatig kuze aussetzer
kann das mit Debounce zusammen hängen und kann ich das irgentwie verhindern.
Code:$regfile = "m8515.dat" $framesize = 32 $swstack = 32 $hwstack = 32 $crystal = 1000000 Config Portc.0 = Output Config Portc.1 = Output Config Pina.7 = Input Porta.7 = 1 Config Pina.5 = Input Porta.5 = 1 Led1 Alias Portc.0 Led2 Alias Portc.1 Taster1 Alias Pina.7 Taster2 Alias Pina.5 Config Timer0 = Timer , Prescale = 8 'Konfiguriere Timer1 Enable Timer0 'schalte den Timer1 ein On Timer0 Isr_von_timer0 'verzweige bei Timer1 überlauf zu Isr_von_Timer1 Enable Interrupts Timer0 = 130 Dim X As Integer Dim Y As Bit Led1 = 1 Led2 = 0 X = 200 Main: Do '130 = 100% 255 = 0% If X <= Timer0 Then Led1 = 0 Else Led1 = 1 End If If X >= 140 Then Debounce Taster1 , 0 , On_taster1 , Sub End If If X <= 245 Then Debounce Taster2 , 0 , On_taster2 , Sub End If Loop On_taster1: X = X - 10 Goto Main: On_taster2: X = X + 10 Goto Main: Isr_von_timer0: Timer0 = 130 Return







Zitieren

Lesezeichen