Ich hab das Problem das bei mir jetzt 1023 PWM jetzt 0 V sind. Hier der Code:
1 | $regfile = "m8def.dat" |
2 | $crystal = 1000000 |
3 | $baud = 9600 |
4 | |
5 | Config Portc.5 = Output |
6 | Config Portc.4 = Output |
7 | Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , _ |
8 | Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2 |
9 | Config Lcd = 16 * 1 |
10 | Cursor Off |
11 | |
12 | Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Prescale = 1 |
13 | |
14 | |
15 | Config Adc = Single , Prescaler = Auto , Reference = Avcc |
16 | Start Adc |
17 | Dim Wert As Integer |
18 | |
19 | Do |
20 | |
21 | |
22 | Wert = Getadc(0) |
23 | Compare1a = Wert |
24 | |
25 | Locate 1 , 1 |
26 | Lcd ; Wert |
27 | Waitms 10 |
28 | Cls |
29 | |
30 | If Wert < 600 Then |
31 | |
32 | Portc.5 = 1 |
33 | Elseif Wert > 700 Then |
34 | |
35 | Portc.4 = 1 |
36 | |
37 | Else |
38 | Portc.5 = 0 |
39 | Portc.4 = 0 |
40 | |
41 | End If |
42 | Loop |
43 | End |
wo liegt der Fehler? ich such jetzt schon 3 Stunden nach dem Problem und finde nichts ... hab nur ich den Fehler? Normal sollten ja bei 1023 5 v anliegen ... Danke