Hallo,
bei dem einfachen Programm funkts jetzt, wenn ich es aber in mein Hauptprogramm einbaue, wird nur Piep() ausgeführt. Langasam bin ich am verzweifeln.
mfgCode:$regfile = "m8def.dat" $framesize = 60 $swstack = 60 $hwstack = 60 $crystal = 1000000 Config Lcd = 16 * 1 Config Lcdpin = Pin , Db4 = Portd.0 , Db5 = Portd.1 , Db6 = Portd.2 , Db7 = Portd.3 , E = Portd.5 , Rs = Portd.4 Config Lcdbus = 4 Config Adc = Single , Prescaler = Auto Start Adc Dim W As Integer Dim A As Single Dim B As Single Dim C As Single Dim D As Single Dim E As Single Config Portc.5 = Output Config Portc.4 = Output Config Portc.3 = Output Config Portb.2 = Output Config Pinb.1 = Input Portb.1 = 1 Declare Sub Piep() Declare Sub Spannung() Sub Piep() Config Timer1 = Pwm , Pwm = 8 , Compare B Pwm = Clear Up , Prescale = 1 Pwm1b = 180 Wait 1 Pwm1b = 0 Wait 1 End Sub Sub Spannung() A = 5 / 1024 C = W * A D = C * 100 E = Round(d) E = E / 100 B = E * 3 Cursor Off Cls Locate 1 , 1 Lcd Fusing(b , "#.##") ; "V" 'Spannung Wait 1 End Sub Do W = Getadc(1) If 390 < W Then Portc.3 = 1 'Grün End If If 340 < W And W < 390 Then Portc.4 = 1 'Gelb End If If W < 340 Then Portc.5 = 1 'Rot End If If Pinb.1 = 1 Then Call Piep Else Call Spannung End If Loop End







Zitieren
Lesezeichen