Hallo , ich will so eine Art Universalanzeige mit Schaltpunkten bauen , die Platine habe ich mit SprintLayout entworfen gefräst und bestückt . Der reine Analogteil (Anzeige eines Analogwertes und schalten von 2 Relais bei einer voreingestellten Schwelle funktioniert ) aber wenn ich den Programmteil um einen Wert einzugeben und dann im Eprom abzuspeichern aktivieren will klappt nichts mehr .
1 | '$sim Auskommentieren für das echte Programm |
2 | $regfile = "m8def.dat" |
3 | $crystal = 1000000 |
4 | $hwstack = 32 |
5 | $swstack = 32 |
6 | $framesize = 40 |
7 | |
8 | |
9 | 'Taster1 Programmiermodus |
10 | 'Config Portc.1 = Input |
11 | 'Portc.1 = 1 |
12 | 'Taster1 Alias Portc.1 |
13 | 'Taster Relais 1 |
14 | 'Config Pinc.2 = Input |
15 | 'Taster2 Alias Pinc.2 |
16 | 'Pinc.2 = 1 |
17 | 'Taster Relais 2 |
18 | 'Config Pinc.3 = Input |
19 | 'Taster3 Alias Pinc.3 |
20 | 'Pinc.3 = 1 |
21 | |
22 | |
23 | Dim X As Word |
24 | Dim Unt As Byte |
25 | 'Dim Ee_unt As Eram Byte |
26 | Dim Ob As Byte |
27 | 'Dim Ee_ob As Eram Byte |
28 | Config Adc = Single , Prescaler = Auto , Reference = Internal |
29 | Config Lcdpin = Pin , Rs = Portd.4 , E = Portd.5 , Db4 = Portd.0 , _ |
30 | Db5 = Portd.1 , Db6 = Portd.2 , Db7 = Portd.3 |
31 | Config Portb.1 = Output |
32 | Config Portb.2 = Output |
33 | Config Lcd = 16 * 2 |
34 | Start Adc |
35 | Unt = 60 |
36 | Ob = 80 |
37 | 'Unt = Ee_unt |
38 | 'Ob = Ee_ob |
39 | Cls |
40 | |
41 | |
42 | Do |
43 | |
44 | Locate 1 , 1 |
45 | Lcd " Sauerstoff " |
46 | Waitms 10 |
47 | X = Getadc(0) |
48 | X = X / 10 |
49 | Locate 2 , 1 |
50 | Lcd " " ; X ; " " |
51 | Locate 2 , 6 |
52 | Lcd " " |
53 | Locate 2 , 12 |
54 | Lcd "% " |
55 | If X > Unt Then |
56 | Portb.2 = 1 |
57 | Else |
58 | Portb.2 = 0 |
59 | End If |
60 | If X > Ob Then |
61 | Portb.1 = 1 |
62 | Else |
63 | Portb.1 = 0 |
64 | End If |
65 | Waitms 100 |
66 | |
67 | ' While Taster1 = 0 |
68 | ' Locate 1 , 1 |
69 | ' Lcd "Schaltpkt1=" ; Ob ; " " |
70 | ' Locate 2 , 1 |
71 | ' Lcd "Schaltpkt2=" ; Unt ; " " |
72 | ' Waitms 10 |
73 | ' If Taster2 = 0 Then |
74 | ' Unt = Unt + 1 |
75 | ' Waitms 10 |
76 | ' End If |
77 | ' If Unt > 100 Then |
78 | ' Unt = 1 |
79 | ' End If |
80 | ' If Taster3 = 0 Then |
81 | ' Ob = Ob + 1 |
82 | ' Waitms 10 |
83 | ' End If |
84 | ' If Ob > 100 Then |
85 | ' Ob = 1 |
86 | ' End If |
87 | |
88 | ' Wend |
89 | |
90 | ' If Taster2 = 0 Then |
91 | ' Ee_unt = Unt |
92 | ' Ee_ob = Ob |
93 | ' End If |
94 | |
95 | Loop |
96 | |
97 | End 'end program |
Vielen Dank für jede Antwort Hans