1 | #include <doxygen.h>
|
2 | #include <NexButton.h>
|
3 | #include <NexConfig.h>
|
4 | #include <NexCrop.h>
|
5 | #include <NexDualStateButton.h>
|
6 | #include <NexGauge.h>
|
7 | #include <NexHardware.h>
|
8 | #include <NexHotspot.h>
|
9 | #include <NexNumber.h>
|
10 | #include <NexObject.h>
|
11 | #include <NexPage.h>
|
12 | #include <NexPicture.h>
|
13 | #include <NexProgressBar.h>
|
14 | #include <NexSlider.h>
|
15 | #include <NexText.h>
|
16 | #include <NexTimer.h>
|
17 | #include <Nextion.h>
|
18 | #include <NexTouch.h>
|
19 | #include <NexUpload.h>
|
20 | #include <NexWaveform.h>
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | #include <SPI.h>
|
32 | #include "Adafruit_MAX31855.h"
|
33 | #define MAXDO 3 // Definierte Pins für MAX31855
|
34 | #define MAXCS2 6
|
35 | #define MAXCS3 7
|
36 | #define MAXCS4 2
|
37 | #define MAXCS1 4 // Definierte Pins für MAX31855, Thermoelement A// Definierte Pins für MAX31855, Thermoelement B
|
38 | #define MAXCLK 5
|
39 | Adafruit_MAX31855 thermocouple1(MAXCLK, MAXCS1, MAXDO); // Definierte Pins für MAX31855, Thermoelement 1
|
40 | Adafruit_MAX31855 thermocouple2(MAXCLK, MAXCS2, MAXDO); // Definierte Pins für MAX31855, Thermoelement 2
|
41 | Adafruit_MAX31855 thermocouple3(MAXCLK, MAXCS3, MAXDO); // Definierte Pins für MAX31855, Thermoelement 3
|
42 | Adafruit_MAX31855 thermocouple4(MAXCLK, MAXCS4, MAXDO); // Definierte Pins für MAX31855, Thermoelement 4
|
43 |
|
44 |
|
45 |
|
46 | double Thermoelement1;
|
47 | double Thermoelement2;
|
48 | double Thermoelement3;
|
49 | double Thermoelement4;
|
50 |
|
51 | int i = 0;
|
52 | double internalTemp1;
|
53 | double rawTemp1;
|
54 | double thermocoupleVoltage1;
|
55 | double internalVoltage1;
|
56 | double correctedTemp1;
|
57 |
|
58 | double rawTemp2;
|
59 | double internalTemp2;
|
60 | double thermocoupleVoltage2;
|
61 | double internalVoltage2;
|
62 | double correctedTemp2;
|
63 |
|
64 | double internalTemp3;
|
65 | double rawTemp3;
|
66 | double thermocoupleVoltage3;
|
67 | double internalVoltage3;
|
68 | double correctedTemp3;
|
69 |
|
70 |
|
71 | double internalTemp4;
|
72 | double rawTemp4;
|
73 | double thermocoupleVoltage4;
|
74 | double internalVoltage4;
|
75 | double correctedTemp4;
|
76 |
|
77 |
|
78 | int dauer1;
|
79 | int brightness = 5;
|
80 | int brightness1 = 0;
|
81 | //____________Analog Eingänge____________________________________
|
82 |
|
83 |
|
84 | float MesswertA0 = 0;
|
85 | float Abgasdruck = 0;
|
86 | float MesswertA1 = 0;
|
87 | float Lambda = 0;
|
88 | float MesswertA2 = 0;
|
89 | float Luftmasse = 0;
|
90 | float MesswertA3 = 0;
|
91 | float Ladedruck = 0;
|
92 | float MesswertA4 = 0;
|
93 | float Saugrohrtemperatur = 0;
|
94 | float MesswertA5 = 0;
|
95 | float Unterdruck_Ansaugung = 0;
|
96 | float MesswertA6 = 0;
|
97 | float Ansaug_Temperatur = 0;
|
98 | float MesswertA7 = 0;
|
99 | float Oel_Temperatur = 0;
|
100 | float MesswertA8 = 0;
|
101 | float VTG_Position = 0;
|
102 | float MesswertA9 = 0;
|
103 | float Kraftstoff_Druck = 0;
|
104 |
|
105 |
|
106 | //_____________Display___________________________________________________
|
107 |
|
108 |
|
109 | NexWaveform p1_s0 = NexWaveform(1,2,"s0"); //TEST
|
110 | NexWaveform p2_s0 = NexWaveform (2,1,"s0");
|
111 | NexWaveform p3_s0 = NexWaveform (3,1,"s0");
|
112 | NexWaveform p4_s0 = NexWaveform (4,1,"s0");
|
113 | NexWaveform p5_s0 = NexWaveform (5,1,"s0");
|
114 | NexWaveform p6_s0 = NexWaveform (6,1,"s0");
|
115 | NexWaveform p7_s0 = NexWaveform (7,1,"s0");
|
116 | NexWaveform p8_s0 = NexWaveform (8,1,"s0");
|
117 | NexWaveform p9_s0 = NexWaveform (9,1,"s0");
|
118 | NexWaveform p10_s0 = NexWaveform (10,1,"s0");
|
119 | NexWaveform p20_s0 = NexWaveform (20,2,"s0");
|
120 | NexWaveform p21_s0 = NexWaveform (21,2,"s0");
|
121 | NexWaveform p22_s0 = NexWaveform (22,2,"s0");
|
122 | NexWaveform p23_s0 = NexWaveform (23,2,"s0");
|
123 | NexWaveform p24_s0 = NexWaveform (24,2,"s0");
|
124 |
|
125 |
|
126 |
|
127 | NexNumber p0_n0 = NexNumber(0,10,"n0");
|
128 | NexNumber p0_n1 = NexNumber(0,11,"n1");
|
129 | NexNumber p0_n2 = NexNumber(0,12,"n2");
|
130 | NexNumber p0_n3 = NexNumber(0,13,"n3");
|
131 | NexNumber p0_n4 = NexNumber(0,14,"n4");
|
132 | NexNumber p0_n5 = NexNumber(0,15,"n5");
|
133 | NexNumber p0_n6 = NexNumber(0,16,"n6");
|
134 | NexNumber p0_n7 = NexNumber(0,17,"n7");
|
135 | NexNumber p0_n8 = NexNumber(0,34,"n8");
|
136 | NexNumber p0_n9 = NexNumber(0,35,"n9");
|
137 | NexNumber p0_n10 = NexNumber(0,36,"n10");
|
138 | NexNumber p0_n11 = NexNumber(0,37,"n11");
|
139 | NexNumber p0_n12 = NexNumber(0,38,"n12");
|
140 | NexNumber p0_n13 = NexNumber(0,39,"n13");
|
141 | NexNumber p0_n14 = NexNumber(0,40,"n14");
|
142 | NexNumber p0_n15 = NexNumber(0,41,"n15");
|
143 | NexNumber p1_n0 = NexNumber(1,5,"n0");
|
144 | NexNumber p1_n1 = NexNumber(1,6,"n1");
|
145 | NexNumber p1_n2 = NexNumber(1,11,"n2");
|
146 | NexNumber p1_n3 = NexNumber(1,12,"n3");
|
147 | NexNumber p2_n0 = NexNumber(2,4,"n0");
|
148 | NexNumber p3_n0 = NexNumber(3,4,"n0");
|
149 | NexNumber p4_n0 = NexNumber(4,4,"n0");
|
150 | NexNumber p5_n0 = NexNumber(5,4,"n0");
|
151 | NexNumber p6_n0 = NexNumber(6,4,"n0");
|
152 | NexNumber p7_n0 = NexNumber(7,4,"n0");
|
153 | NexNumber p8_n0 = NexNumber(8,4,"n0");
|
154 | NexNumber p9_n0 = NexNumber(9,4,"n0");
|
155 | NexNumber p10_n0 = NexNumber(10,4,"n0");
|
156 | NexNumber p20_n0 = NexNumber(1,5,"n0");
|
157 | NexNumber p20_n1 = NexNumber(1,6,"n1");
|
158 | NexNumber p20_n2 = NexNumber(1,11,"n2");
|
159 | NexNumber p20_n3 = NexNumber(1,12,"n3");
|
160 | NexNumber p21_n0 = NexNumber(1,5,"n0");
|
161 | NexNumber p21_n1 = NexNumber(1,6,"n1");
|
162 | NexNumber p21_n2 = NexNumber(1,11,"n2");
|
163 | NexNumber p22_n0 = NexNumber(1,5,"n0");
|
164 | NexNumber p22_n1 = NexNumber(1,6,"n1");
|
165 | NexNumber p22_n2 = NexNumber(1,11,"n2");
|
166 | NexNumber p23_n0 = NexNumber(1,5,"n0");
|
167 | NexNumber p23_n1 = NexNumber(1,6,"n1");
|
168 | NexNumber p23_n2 = NexNumber(1,11,"n2");
|
169 | NexNumber p23_n3 = NexNumber(1,12,"n3");
|
170 | NexNumber p24_n0 = NexNumber(1,5,"n0");
|
171 | NexNumber p24_n1 = NexNumber(1,6,"n1");
|
172 | NexNumber p24_n2 = NexNumber(1,11,"n2");
|
173 | NexNumber p24_n3 = NexNumber(1,12,"n3");
|
174 |
|
175 |
|
176 |
|
177 | //___________________Page____________________________________________________
|
178 | int p = 0;
|
179 | char buffer[100] = {0};
|
180 | NexButton p0_b0 = NexButton(0, 1, "b0"); // Messwet Gruppen
|
181 | NexButton p0_b1 = NexButton(0, 52, "b1"); // MEsswerte Einzeln
|
182 | NexButton p0_b2 = NexButton(0, 53, "b2"); // Logen
|
183 | NexButton p0_b3 = NexButton(0, 50, "b3"); // Heller
|
184 | NexButton p0_b4 = NexButton(0, 51, "b4"); //Dunkler
|
185 | NexButton p1_b0 = NexButton(1, 1, "b0");
|
186 | NexButton p2_b0 = NexButton(2, 2, "b0");
|
187 | NexButton p3_b0 = NexButton(3, 2, "b0");
|
188 | NexButton p4_b0 = NexButton(4, 2, "b0");
|
189 | NexButton p5_b0 = NexButton(5, 2, "b0");
|
190 | NexButton p6_b0 = NexButton(6, 2, "b0");
|
191 | NexButton p7_b0 = NexButton(7, 2, "b0");
|
192 | NexButton p8_b0 = NexButton(8, 2, "b0");
|
193 | NexButton p9_b0 = NexButton(9, 2, "b0");
|
194 | NexButton p10_b0 = NexButton(10, 2, "b0");
|
195 | NexButton p20_b0 = NexButton(20, 1, "b0");
|
196 | NexButton p21_b0 = NexButton(21, 1, "b0");
|
197 | NexButton p22_b0 = NexButton(22, 1, "b0");
|
198 | NexButton p23_b0 = NexButton(23, 1, "b0");
|
199 | NexButton p24_b0 = NexButton(24, 1, "b0");
|
200 | NexButton p30_b0 = NexButton(30, 1, "b0");
|
201 |
|
202 |
|
203 | NexPage page0 = NexPage(0, 0, "page0");
|
204 | NexPage page1 = NexPage(1, 0, "page1");
|
205 | NexPage page2 = NexPage(2, 0, "page2");
|
206 | NexPage page3 = NexPage(3, 0, "page3");
|
207 | NexPage page4 = NexPage(4, 0, "page4");
|
208 | NexPage page5 = NexPage(5, 0, "page5");
|
209 | NexPage page6 = NexPage(6, 0, "page6");
|
210 | NexPage page7 = NexPage(7, 0, "page7");
|
211 | NexPage page8 = NexPage(8, 0, "page8");
|
212 | NexPage page9 = NexPage(9, 0, "page9");
|
213 | NexPage page10 = NexPage(10, 0, "page10");
|
214 | NexPage page20 = NexPage(20, 0, "page20");
|
215 | NexPage page21 = NexPage(21, 0, "page21");
|
216 | NexPage page22 = NexPage(22, 0, "page22");
|
217 | NexPage page23 = NexPage(23, 0, "page23");
|
218 | NexPage page24 = NexPage(24, 0, "page24");
|
219 | NexPage page30 = NexPage(20, 0, "page30");
|
220 |
|
221 |
|
222 |
|
223 |
|
224 | NexTouch *nex_listen_list[] =
|
225 | {
|
226 | &p0_b0,
|
227 | &p0_b1,
|
228 | &p0_b2,
|
229 | &p0_b3,
|
230 | &p0_b4,
|
231 | &p1_b0,
|
232 | &p2_b0,
|
233 | &p3_b0,
|
234 | &p4_b0,
|
235 | &p5_b0,
|
236 | &p6_b0,
|
237 | &p7_b0,
|
238 | &p8_b0,
|
239 | &p9_b0,
|
240 | &p10_b0,
|
241 | &p20_b0,
|
242 | &p21_b0,
|
243 | &p22_b0,
|
244 | &p23_b0,
|
245 | &p24_b0,
|
246 | &p30_b0,
|
247 |
|
248 |
|
249 | NULL
|
250 | };
|
251 |
|
252 | void p0_b0PopCallback(void *ptr) { page20.show(); p=20;}
|
253 | void p0_b1PopCallback(void *ptr) { page1.show(); p=1;}
|
254 | void p0_b2PopCallback(void *ptr) { page30.show(); p=30;}
|
255 | void p0_b3PopCallback(void *ptr) { if (brightness <=10) {brightness1 = 1;brightness = brightness +1;}}
|
256 | void p0_b4PopCallback(void *ptr) { if (brightness >=1) {brightness1 = 1;brightness = brightness -1;}}
|
257 | void p1_b0PopCallback(void *ptr) { page2.show(); p=2;}
|
258 | void p2_b0PopCallback(void *ptr) { page3.show(); p=3;}
|
259 | void p3_b0PopCallback(void *ptr) { page4.show(); p=4;}
|
260 | void p4_b0PopCallback(void *ptr) { page5.show(); p=5;}
|
261 | void p5_b0PopCallback(void *ptr) { page6.show(); p=6;}
|
262 | void p6_b0PopCallback(void *ptr) { page7.show(); p=7;}
|
263 | void p7_b0PopCallback(void *ptr) { page8.show(); p=8;}
|
264 | void p8_b0PopCallback(void *ptr) { page9.show(); p=9;}
|
265 | void p9_b0PopCallback(void *ptr) { page10.show(); p=10;}
|
266 | void p10_b0PopCallback(void *ptr) { page0.show(); p=0;}
|
267 | void p20_b0PopCallback(void *ptr) { page21.show(); p=21;}
|
268 | void p21_b0PopCallback(void *ptr) { page22.show(); p=22;}
|
269 | void p22_b0PopCallback(void *ptr) { page23.show(); p=23;}
|
270 | void p23_b0PopCallback(void *ptr) { page24.show(); p=24;}
|
271 | void p24_b0PopCallback(void *ptr) { page0.show(); p=0;}
|
272 | void p30_b0PopCallback(void *ptr) { page0.show(); p=0;}
|
273 |
|
274 |
|
275 |
|
276 |
|
277 | void setup() {
|
278 | Serial.begin (9600);
|
279 | nexInit();
|
280 |
|
281 | p0_b0.attachPop(p0_b0PopCallback, &p0_b0);
|
282 | p0_b1.attachPop(p0_b1PopCallback, &p0_b1);
|
283 | p0_b2.attachPop(p0_b2PopCallback, &p0_b2);
|
284 | p0_b3.attachPop(p0_b3PopCallback, &p0_b3);
|
285 | p0_b4.attachPop(p0_b4PopCallback, &p0_b4);
|
286 | p1_b0.attachPop(p1_b0PopCallback, &p1_b0);
|
287 | p2_b0.attachPop(p2_b0PopCallback, &p2_b0);
|
288 | p3_b0.attachPop(p3_b0PopCallback, &p3_b0);
|
289 | p4_b0.attachPop(p4_b0PopCallback, &p4_b0);
|
290 | p5_b0.attachPop(p5_b0PopCallback, &p5_b0);
|
291 | p6_b0.attachPop(p6_b0PopCallback, &p6_b0);
|
292 | p7_b0.attachPop(p7_b0PopCallback, &p7_b0);
|
293 | p8_b0.attachPop(p8_b0PopCallback, &p8_b0);
|
294 | p9_b0.attachPop(p9_b0PopCallback, &p9_b0);
|
295 | p10_b0.attachPop(p10_b0PopCallback, &p10_b0);
|
296 | p20_b0.attachPop(p20_b0PopCallback, &p20_b0);
|
297 | p21_b0.attachPop(p21_b0PopCallback, &p21_b0);
|
298 | p22_b0.attachPop(p22_b0PopCallback, &p22_b0);
|
299 | p23_b0.attachPop(p23_b0PopCallback, &p23_b0);
|
300 | p24_b0.attachPop(p24_b0PopCallback, &p24_b0);
|
301 | p30_b0.attachPop(p30_b0PopCallback, &p30_b0);
|
302 | }
|
303 |
|
304 |
|
305 | void loop() {
|
306 | nexLoop(nex_listen_list);
|
307 | int start = 0;
|
308 | int dauer = 0;
|
309 | start = millis();
|
310 |
|
311 |
|
312 |
|
313 | //____________________________________________________________Thermoelement 1_______________________________________________________________________
|
314 |
|
315 | if ((p==0) || (p==1) || (p==20)){
|
316 |
|
317 | internalTemp1 = thermocouple1.readInternal(); // Read the internal temperature of the MAX31855.
|
318 | nexLoop(nex_listen_list);
|
319 | rawTemp1 = thermocouple1.readCelsius(); // Read the temperature of the thermocouple. This temp is compensated for cold junction temperature.
|
320 | nexLoop(nex_listen_list);
|
321 | thermocoupleVoltage1= 0;
|
322 | internalVoltage1 = 0;
|
323 | correctedTemp1 = 0;
|
324 |
|
325 | {thermocoupleVoltage1 = (rawTemp1 - internalTemp1)*0.041276; // C * mv/C = mV
|
326 | if (internalTemp1 >= 0) { // For positive temperatures use appropriate NIST coefficients
|
327 | double c[] = {-0.176004136860E-01, 0.389212049750E-01, 0.185587700320E-04, -0.994575928740E-07, 0.318409457190E-09, -0.560728448890E-12, 0.560750590590E-15, -0.320207200030E-18, 0.971511471520E-22, -0.121047212750E-25};
|
328 | int cLength = sizeof(c) / sizeof(c[0]);
|
329 | double a0 = 0.118597600000E+00;
|
330 | double a1 = -0.118343200000E-03;
|
331 | double a2 = 0.126968600000E+03;
|
332 | for (i = 0; i < cLength; i++) {
|
333 | internalVoltage1 += c[i] * pow(internalTemp1, i);
|
334 | }
|
335 | internalVoltage1 += a0 * exp(a1 * pow((internalTemp1 - a2), 2));
|
336 | }
|
337 | else if (internalTemp1 < 0) {
|
338 | double c[] = {0.000000000000E+00, 0.394501280250E-01, 0.236223735980E-04 - 0.328589067840E-06, -0.499048287770E-08, -0.675090591730E-10, -0.574103274280E-12, -0.310888728940E-14, -0.104516093650E-16, -0.198892668780E-19, -0.163226974860E-22};
|
339 | int cLength = sizeof(c) / sizeof(c[0]);
|
340 | for (i = 0; i < cLength; i++) {
|
341 | internalVoltage1 += c[i] * pow(internalTemp1, i) ;
|
342 | }
|
343 | }
|
344 | double totalVoltage1 = thermocoupleVoltage1 + internalVoltage1;
|
345 | if (totalVoltage1 < 0) { // Temperature is between -200 and 0C.
|
346 | double d[] = {0.0000000E+00, 2.5173462E+01, -1.1662878E+00, -1.0833638E+00, -8.9773540E-01, -3.7342377E-01, -8.6632643E-02, -1.0450598E-02, -5.1920577E-04, 0.0000000E+00};
|
347 | int dLength = sizeof(d) / sizeof(d[0]);
|
348 | for (i = 0; i < dLength; i++) {
|
349 | correctedTemp1 += d[i] * pow(totalVoltage1, i);
|
350 | }
|
351 | }
|
352 | else if (totalVoltage1 < 20.644) { // Temperature is between 0C and 500C.
|
353 | double d[] = {0.000000E+00, 2.508355E+01, 7.860106E-02, -2.503131E-01, 8.315270E-02, -1.228034E-02, 9.804036E-04, -4.413030E-05, 1.057734E-06, -1.052755E-08};
|
354 | int dLength = sizeof(d) / sizeof(d[0]);
|
355 | for (i = 0; i < dLength; i++) {
|
356 | correctedTemp1 += d[i] * pow(totalVoltage1, i);
|
357 | }
|
358 | }
|
359 | else if (totalVoltage1 < 54.886 ) { // Temperature is between 500C and 1372C.
|
360 | double d[] = {-1.318058E+02, 4.830222E+01, -1.646031E+00, 5.464731E-02, -9.650715E-04, 8.802193E-06, -3.110810E-08, 0.000000E+00, 0.000000E+00, 0.000000E+00};
|
361 | int dLength = sizeof(d) / sizeof(d[0]);
|
362 | for (i = 0; i < dLength; i++) {
|
363 | correctedTemp1 += d[i] * pow(totalVoltage1, i);
|
364 | }}
|
365 |
|
366 |
|
367 | }
|
368 | nexLoop(nex_listen_list);
|
369 | //-------------------------------------------------------Thermoelement 2------------------------------------------------------------------------------------------------------------------------------------------
|
370 |
|
371 | rawTemp2 = thermocouple2.readCelsius();
|
372 | nexLoop(nex_listen_list);
|
373 | internalTemp2 = thermocouple2.readInternal();
|
374 | nexLoop(nex_listen_list);
|
375 | thermocoupleVoltage2= 0;
|
376 | internalVoltage2 = 0;
|
377 | correctedTemp2 = 0;
|
378 | {thermocoupleVoltage2 = (rawTemp2 - internalTemp2)*0.041276; // C * mv/C = mV
|
379 | if (internalTemp2 >= 0) { // For positive temperatures use appropriate NIST coefficients
|
380 | double c[] = {-0.176004136860E-01, 0.389212049750E-01, 0.185587700320E-04, -0.994575928740E-07, 0.318409457190E-09, -0.560728448890E-12, 0.560750590590E-15, -0.320207200030E-18, 0.971511471520E-22, -0.121047212750E-25};
|
381 | int cLength = sizeof(c) / sizeof(c[0]);
|
382 | double a0 = 0.118597600000E+00;
|
383 | double a1 = -0.118343200000E-03;
|
384 | double a2 = 0.126968600000E+03;
|
385 | for (i = 0; i < cLength; i++) {
|
386 | internalVoltage2 += c[i] * pow(internalTemp2, i);
|
387 | }
|
388 | internalVoltage2 += a0 * exp(a1 * pow((internalTemp2 - a2), 2));
|
389 | }
|
390 | else if (internalTemp2 < 0) {
|
391 | double c[] = {0.000000000000E+00, 0.394501280250E-01, 0.236223735980E-04 - 0.328589067840E-06, -0.499048287770E-08, -0.675090591730E-10, -0.574103274280E-12, -0.310888728940E-14, -0.104516093650E-16, -0.198892668780E-19, -0.163226974860E-22};
|
392 | int cLength = sizeof(c) / sizeof(c[0]);
|
393 | for (i = 0; i < cLength; i++) {
|
394 | internalVoltage2 += c[i] * pow(internalTemp2, i) ;
|
395 | }
|
396 | }
|
397 | double totalVoltage2 = thermocoupleVoltage2 + internalVoltage2;
|
398 | if (totalVoltage2 < 0) { // Temperature is between -200 and 0C.
|
399 | double d[] = {0.0000000E+00, 2.5173462E+01, -1.1662878E+00, -1.0833638E+00, -8.9773540E-01, -3.7342377E-01, -8.6632643E-02, -1.0450598E-02, -5.1920577E-04, 0.0000000E+00};
|
400 | int dLength = sizeof(d) / sizeof(d[0]);
|
401 | for (i = 0; i < dLength; i++) {
|
402 | correctedTemp2 += d[i] * pow(totalVoltage2, i);
|
403 | }
|
404 | }
|
405 | else if (totalVoltage2 < 20.644) { // Temperature is between 0C and 500C.
|
406 | double d[] = {0.000000E+00, 2.508355E+01, 7.860106E-02, -2.503131E-01, 8.315270E-02, -1.228034E-02, 9.804036E-04, -4.413030E-05, 1.057734E-06, -1.052755E-08};
|
407 | int dLength = sizeof(d) / sizeof(d[0]);
|
408 | for (i = 0; i < dLength; i++) {
|
409 | correctedTemp2 += d[i] * pow(totalVoltage2, i);
|
410 | }
|
411 | }
|
412 | else if (totalVoltage2 < 54.886 ) { // Temperature is between 500C and 1372C.
|
413 | double d[] = {-1.318058E+02, 4.830222E+01, -1.646031E+00, 5.464731E-02, -9.650715E-04, 8.802193E-06, -3.110810E-08, 0.000000E+00, 0.000000E+00, 0.000000E+00};
|
414 | int dLength = sizeof(d) / sizeof(d[0]);
|
415 | for (i = 0; i < dLength; i++) {
|
416 | correctedTemp2 += d[i] * pow(totalVoltage2, i);
|
417 | }}
|
418 |
|
419 |
|
420 |
|
421 | }
|
422 |
|
423 | nexLoop(nex_listen_list);
|
424 |
|
425 | //------------------------------------------------------Thermoelement 3--------------------------------------------------------------------------------------------------------------------------------
|
426 |
|
427 |
|
428 | internalTemp3 = thermocouple3.readInternal();
|
429 | nexLoop(nex_listen_list);
|
430 | rawTemp3 = thermocouple3.readCelsius();
|
431 | nexLoop(nex_listen_list);
|
432 | thermocoupleVoltage3= 0;
|
433 | internalVoltage3 = 0;
|
434 | correctedTemp3 = 0;
|
435 | {thermocoupleVoltage3 = (rawTemp3 - internalTemp3)*0.041276; // C * mv/C = mV
|
436 | if (internalTemp3 >= 0) { // For positive temperatures use appropriate NIST coefficients
|
437 | double c[] = {-0.176004136860E-01, 0.389212049750E-01, 0.185587700320E-04, -0.994575928740E-07, 0.318409457190E-09, -0.560728448890E-12, 0.560750590590E-15, -0.320207200030E-18, 0.971511471520E-22, -0.121047212750E-25};
|
438 | int cLength = sizeof(c) / sizeof(c[0]);
|
439 | double a0 = 0.118597600000E+00;
|
440 | double a1 = -0.118343200000E-03;
|
441 | double a2 = 0.126968600000E+03;
|
442 | for (i = 0; i < cLength; i++) {
|
443 | internalVoltage3 += c[i] * pow(internalTemp3, i);
|
444 | }
|
445 | internalVoltage3 += a0 * exp(a1 * pow((internalTemp3 - a2), 2));
|
446 | }
|
447 | else if (internalTemp3 < 0) {
|
448 | double c[] = {0.000000000000E+00, 0.394501280250E-01, 0.236223735980E-04 - 0.328589067840E-06, -0.499048287770E-08, -0.675090591730E-10, -0.574103274280E-12, -0.310888728940E-14, -0.104516093650E-16, -0.198892668780E-19, -0.163226974860E-22};
|
449 | int cLength = sizeof(c) / sizeof(c[0]);
|
450 | for (i = 0; i < cLength; i++) {
|
451 | internalVoltage3 += c[i] * pow(internalTemp3, i) ;
|
452 | }
|
453 | }
|
454 | double totalVoltage3 = thermocoupleVoltage3 + internalVoltage3;
|
455 | if (totalVoltage3 < 0) { // Temperature is between -200 and 0C.
|
456 | double d[] = {0.0000000E+00, 2.5173462E+01, -1.1662878E+00, -1.0833638E+00, -8.9773540E-01, -3.7342377E-01, -8.6632643E-02, -1.0450598E-02, -5.1920577E-04, 0.0000000E+00};
|
457 | int dLength = sizeof(d) / sizeof(d[0]);
|
458 | for (i = 0; i < dLength; i++) {
|
459 | correctedTemp3 += d[i] * pow(totalVoltage3, i);
|
460 | }
|
461 | }
|
462 | else if (totalVoltage3 < 20.644) { // Temperature is between 0C and 500C.
|
463 | double d[] = {0.000000E+00, 2.508355E+01, 7.860106E-02, -2.503131E-01, 8.315270E-02, -1.228034E-02, 9.804036E-04, -4.413030E-05, 1.057734E-06, -1.052755E-08};
|
464 | int dLength = sizeof(d) / sizeof(d[0]);
|
465 | for (i = 0; i < dLength; i++) {
|
466 | correctedTemp3 += d[i] * pow(totalVoltage3, i);
|
467 | }
|
468 | }
|
469 | else if (totalVoltage3 < 54.886 ) { // Temperature is between 500C and 1372C.
|
470 | double d[] = {-1.318058E+02, 4.830222E+01, -1.646031E+00, 5.464731E-02, -9.650715E-04, 8.802193E-06, -3.110810E-08, 0.000000E+00, 0.000000E+00, 0.000000E+00};
|
471 | int dLength = sizeof(d) / sizeof(d[0]);
|
472 | for (i = 0; i < dLength; i++) {
|
473 | correctedTemp3 += d[i] * pow(totalVoltage3, i);
|
474 | }}
|
475 |
|
476 | }
|
477 |
|
478 | nexLoop(nex_listen_list);
|
479 | //----------------------------------------------------Thermoelement 4------------------------------------------------------------------------------------------------------------------------------------
|
480 |
|
481 | internalTemp4 = thermocouple4.readInternal();
|
482 | nexLoop(nex_listen_list);
|
483 | rawTemp4 = thermocouple4.readCelsius();
|
484 | nexLoop(nex_listen_list);
|
485 | thermocoupleVoltage4= 0;
|
486 | internalVoltage4 = 0;
|
487 | correctedTemp4 = 0;
|
488 | {thermocoupleVoltage4 = (rawTemp4 - internalTemp4)*0.041276; // C * mv/C = mV
|
489 | if (internalTemp4 >= 0) { // For positive temperatures use appropriate NIST coefficients
|
490 | double c[] = {-0.176004136860E-01, 0.389212049750E-01, 0.185587700320E-04, -0.994575928740E-07, 0.318409457190E-09, -0.560728448890E-12, 0.560750590590E-15, -0.320207200030E-18, 0.971511471520E-22, -0.121047212750E-25};
|
491 | int cLength = sizeof(c) / sizeof(c[0]);
|
492 | double a0 = 0.118597600000E+00;
|
493 | double a1 = -0.118343200000E-03;
|
494 | double a2 = 0.126968600000E+03;
|
495 | for (i = 0; i < cLength; i++) {
|
496 | internalVoltage4 += c[i] * pow(internalTemp4, i);
|
497 | }
|
498 | internalVoltage4 += a0 * exp(a1 * pow((internalTemp4 - a2), 2));
|
499 | }
|
500 | else if (internalTemp4 < 0) {
|
501 | double c[] = {0.000000000000E+00, 0.394501280250E-01, 0.236223735980E-04 - 0.328589067840E-06, -0.499048287770E-08, -0.675090591730E-10, -0.574103274280E-12, -0.310888728940E-14, -0.104516093650E-16, -0.198892668780E-19, -0.163226974860E-22};
|
502 | int cLength = sizeof(c) / sizeof(c[0]);
|
503 | for (i = 0; i < cLength; i++) {
|
504 | internalVoltage4 += c[i] * pow(internalTemp4, i) ;
|
505 | }
|
506 | }
|
507 | double totalVoltage4 = thermocoupleVoltage4 + internalVoltage4;
|
508 | if (totalVoltage4 < 0) { // Temperature is between -200 and 0C.
|
509 | double d[] = {0.0000000E+00, 2.5173462E+01, -1.1662878E+00, -1.0833638E+00, -8.9773540E-01, -3.7342377E-01, -8.6632643E-02, -1.0450598E-02, -5.1920577E-04, 0.0000000E+00};
|
510 | int dLength = sizeof(d) / sizeof(d[0]);
|
511 | for (i = 0; i < dLength; i++) {
|
512 | correctedTemp4 += d[i] * pow(totalVoltage4, i);
|
513 | }
|
514 | }
|
515 | else if (totalVoltage4 < 20.644) { // Temperature is between 0C and 500C.
|
516 | double d[] = {0.000000E+00, 2.508355E+01, 7.860106E-02, -2.503131E-01, 8.315270E-02, -1.228034E-02, 9.804036E-04, -4.413030E-05, 1.057734E-06, -1.052755E-08};
|
517 | int dLength = sizeof(d) / sizeof(d[0]);
|
518 | for (i = 0; i < dLength; i++) {
|
519 | correctedTemp4 += d[i] * pow(totalVoltage4, i);
|
520 | }
|
521 | }
|
522 | else if (totalVoltage4 < 54.886 ) { // Temperature is between 500C and 1372C.
|
523 | double d[] = {-1.318058E+02, 4.830222E+01, -1.646031E+00, 5.464731E-02, -9.650715E-04, 8.802193E-06, -3.110810E-08, 0.000000E+00, 0.000000E+00, 0.000000E+00};
|
524 | int dLength = sizeof(d) / sizeof(d[0]);
|
525 | for (i = 0; i < dLength; i++) {
|
526 | correctedTemp4 += d[i] * pow(totalVoltage4, i);
|
527 | }}
|
528 |
|
529 |
|
530 | }
|
531 |
|
532 | Thermoelement1 = correctedTemp1;
|
533 | Thermoelement2 = correctedTemp2;
|
534 | Thermoelement3 = correctedTemp3;
|
535 | Thermoelement4 = correctedTemp4;
|
536 | }
|
537 |
|
538 | nexLoop(nex_listen_list);
|
539 |
|
540 |
|
541 |
|
542 | //_____________________________________Thermoelement 1 nur auf Seite 21 Aktiv__________________________________________________________________________
|
543 | if ((p==21)){
|
544 |
|
545 | internalTemp1 = thermocouple1.readInternal(); // Read the internal temperature of the MAX31855.
|
546 | nexLoop(nex_listen_list);
|
547 | rawTemp1 = thermocouple1.readCelsius(); // Read the temperature of the thermocouple. This temp is compensated for cold junction temperature.
|
548 | nexLoop(nex_listen_list);
|
549 | thermocoupleVoltage1= 0;
|
550 | internalVoltage1 = 0;
|
551 | correctedTemp1 = 0;
|
552 |
|
553 | {thermocoupleVoltage1 = (rawTemp1 - internalTemp1)*0.041276; // C * mv/C = mV
|
554 | if (internalTemp1 >= 0) { // For positive temperatures use appropriate NIST coefficients
|
555 | double c[] = {-0.176004136860E-01, 0.389212049750E-01, 0.185587700320E-04, -0.994575928740E-07, 0.318409457190E-09, -0.560728448890E-12, 0.560750590590E-15, -0.320207200030E-18, 0.971511471520E-22, -0.121047212750E-25};
|
556 | int cLength = sizeof(c) / sizeof(c[0]);
|
557 | double a0 = 0.118597600000E+00;
|
558 | double a1 = -0.118343200000E-03;
|
559 | double a2 = 0.126968600000E+03;
|
560 | for (i = 0; i < cLength; i++) {
|
561 | internalVoltage1 += c[i] * pow(internalTemp1, i);
|
562 | }
|
563 | internalVoltage1 += a0 * exp(a1 * pow((internalTemp1 - a2), 2));
|
564 | }
|
565 | else if (internalTemp1 < 0) {
|
566 | double c[] = {0.000000000000E+00, 0.394501280250E-01, 0.236223735980E-04 - 0.328589067840E-06, -0.499048287770E-08, -0.675090591730E-10, -0.574103274280E-12, -0.310888728940E-14, -0.104516093650E-16, -0.198892668780E-19, -0.163226974860E-22};
|
567 | int cLength = sizeof(c) / sizeof(c[0]);
|
568 | for (i = 0; i < cLength; i++) {
|
569 | internalVoltage1 += c[i] * pow(internalTemp1, i) ;
|
570 | }
|
571 | }
|
572 | double totalVoltage1 = thermocoupleVoltage1 + internalVoltage1;
|
573 | if (totalVoltage1 < 0) { // Temperature is between -200 and 0C.
|
574 | double d[] = {0.0000000E+00, 2.5173462E+01, -1.1662878E+00, -1.0833638E+00, -8.9773540E-01, -3.7342377E-01, -8.6632643E-02, -1.0450598E-02, -5.1920577E-04, 0.0000000E+00};
|
575 | int dLength = sizeof(d) / sizeof(d[0]);
|
576 | for (i = 0; i < dLength; i++) {
|
577 | correctedTemp1 += d[i] * pow(totalVoltage1, i);
|
578 | }
|
579 | }
|
580 | else if (totalVoltage1 < 20.644) { // Temperature is between 0C and 500C.
|
581 | double d[] = {0.000000E+00, 2.508355E+01, 7.860106E-02, -2.503131E-01, 8.315270E-02, -1.228034E-02, 9.804036E-04, -4.413030E-05, 1.057734E-06, -1.052755E-08};
|
582 | int dLength = sizeof(d) / sizeof(d[0]);
|
583 | for (i = 0; i < dLength; i++) {
|
584 | correctedTemp1 += d[i] * pow(totalVoltage1, i);
|
585 | }
|
586 | }
|
587 | else if (totalVoltage1 < 54.886 ) { // Temperature is between 500C and 1372C.
|
588 | double d[] = {-1.318058E+02, 4.830222E+01, -1.646031E+00, 5.464731E-02, -9.650715E-04, 8.802193E-06, -3.110810E-08, 0.000000E+00, 0.000000E+00, 0.000000E+00};
|
589 | int dLength = sizeof(d) / sizeof(d[0]);
|
590 | for (i = 0; i < dLength; i++) {
|
591 | correctedTemp1 += d[i] * pow(totalVoltage1, i);
|
592 | }}
|
593 |
|
594 |
|
595 | }}
|
596 | nexLoop(nex_listen_list);
|
597 |
|
598 |
|
599 | // _____________________Skalierung Analog Eingänge__________________________________________________
|
600 |
|
601 |
|
602 | MesswertA0 = analogRead(A0); Abgasdruck = map(MesswertA0, 0, 1023, 0,5000)+30; if (Abgasdruck<500) {Abgasdruck =0;} else { Abgasdruck = Abgasdruck - 500; Abgasdruck =map(Abgasdruck, 0, 4500, 0, 13500);}
|
603 | MesswertA1 = analogRead(A1); Lambda = map(MesswertA1, 0, 1023, 1,100);
|
604 | MesswertA2 = analogRead(A2); Luftmasse = map(MesswertA2, 0, 1023, 0,5000);
|
605 | MesswertA3 = analogRead(A3); Ladedruck = map(MesswertA3, 0, 1023, 0,5000); Ladedruck =map(Ladedruck, 1000, 4500, 0, 3000);
|
606 | MesswertA4 = analogRead(A4); Saugrohrtemperatur = map(MesswertA4, 0, 1023, 0,5000);
|
607 | MesswertA5 = analogRead(A5); Unterdruck_Ansaugung = MesswertA5*500000/1024/394 ;
|
608 | MesswertA6 = analogRead(A6); Ansaug_Temperatur = map(MesswertA6, 0, 1023, 0,5000);
|
609 | MesswertA7 = analogRead(A7); Oel_Temperatur = map(MesswertA7, 0, 1023, 0,5000);
|
610 | MesswertA8 = analogRead(A8); VTG_Position = map(MesswertA8, 0, 1023, 0,5000);
|
611 | MesswertA9 = analogRead(A9); Kraftstoff_Druck = map(MesswertA9, 0, 1023, 0,5000)+30; if (Kraftstoff_Druck<500) {Kraftstoff_Druck = 0;} else { Kraftstoff_Druck = Kraftstoff_Druck - 500; Kraftstoff_Druck =map(Kraftstoff_Druck, 0, 4500, 0, 13500); }
|
612 | //___________________________________ Zuweisung der Daten für die Entsprechenden Seiten_______________________________
|
613 | if (p==0){
|
614 | p0_n0.setValue (Thermoelement1); nexLoop(nex_listen_list);
|
615 | p0_n1.setValue (Thermoelement2); nexLoop(nex_listen_list);
|
616 | p0_n2.setValue (Thermoelement3); nexLoop(nex_listen_list);
|
617 | p0_n3.setValue (Thermoelement4); nexLoop(nex_listen_list);
|
618 | p0_n4.setValue (Abgasdruck); nexLoop(nex_listen_list);
|
619 | p0_n5.setValue (Lambda); nexLoop(nex_listen_list);
|
620 | p0_n6.setValue (Luftmasse); nexLoop(nex_listen_list);
|
621 | p0_n8.setValue (Ladedruck); nexLoop(nex_listen_list);
|
622 | p0_n9.setValue (Saugrohrtemperatur); nexLoop(nex_listen_list);
|
623 | p0_n10.setValue (Unterdruck_Ansaugung); nexLoop(nex_listen_list);
|
624 | p0_n11.setValue (Ansaug_Temperatur); nexLoop(nex_listen_list);
|
625 | p0_n12.setValue (Oel_Temperatur); nexLoop(nex_listen_list);
|
626 | p0_n13.setValue (VTG_Position); nexLoop(nex_listen_list);
|
627 | p0_n14.setValue (Kraftstoff_Druck); nexLoop(nex_listen_list);
|
628 | }
|
629 |
|
630 |
|
631 | if (p==1) {
|
632 | p1_n0.setValue (Thermoelement1); nexLoop(nex_listen_list);
|
633 | p1_n1.setValue (Thermoelement2); nexLoop(nex_listen_list);
|
634 | p1_n2.setValue (Thermoelement3); nexLoop(nex_listen_list);
|
635 | p1_n3.setValue (Thermoelement4); nexLoop(nex_listen_list);
|
636 |
|
637 | p1_s0.addValue (0,Thermoelement1/4); nexLoop(nex_listen_list);
|
638 | p1_s0.addValue (1,Thermoelement2/4); nexLoop(nex_listen_list);
|
639 | p1_s0.addValue (2,Thermoelement3/4); nexLoop(nex_listen_list);
|
640 | p1_s0.addValue (3,Thermoelement4/4); nexLoop(nex_listen_list);
|
641 | }
|
642 |
|
643 |
|
644 |
|
645 | if (p==2){
|
646 | p2_n0.setValue (Abgasdruck); nexLoop(nex_listen_list);
|
647 | p2_s0.addValue (0,Abgasdruck); nexLoop(nex_listen_list);
|
648 | delay (100);
|
649 | }
|
650 |
|
651 | if (p==3){
|
652 | p2_n0.setValue (Lambda); nexLoop(nex_listen_list);
|
653 | p2_s0.addValue (0,Lambda); nexLoop(nex_listen_list);
|
654 | delay (100);
|
655 | }
|
656 |
|
657 | if (p==4){
|
658 | p2_n0.setValue (Ladedruck); nexLoop(nex_listen_list);
|
659 | p2_s0.addValue (0,Ladedruck); nexLoop(nex_listen_list);
|
660 | delay (100);
|
661 | }
|
662 |
|
663 | if (p==5){
|
664 | p2_n0.setValue (Luftmasse); nexLoop(nex_listen_list);
|
665 | p2_s0.addValue (0,Luftmasse); nexLoop(nex_listen_list);
|
666 | delay (100);
|
667 | }
|
668 |
|
669 | if (p==6){
|
670 | p6_n0.setValue (Unterdruck_Ansaugung); nexLoop(nex_listen_list);
|
671 | p6_s0.addValue (0,Unterdruck_Ansaugung/2); nexLoop(nex_listen_list);
|
672 | delay (100);
|
673 | }
|
674 |
|
675 | if (p==7){
|
676 | p2_n0.setValue (Saugrohrtemperatur); nexLoop(nex_listen_list);
|
677 | p2_s0.addValue (0,Saugrohrtemperatur); nexLoop(nex_listen_list);
|
678 | delay (100);
|
679 | }
|
680 |
|
681 | if (p==8){
|
682 | p2_n0.setValue (Oel_Temperatur); nexLoop(nex_listen_list);
|
683 | p2_s0.addValue (0,Oel_Temperatur); nexLoop(nex_listen_list);
|
684 | delay (100);
|
685 | }
|
686 |
|
687 | if (p==9){
|
688 | p2_n0.setValue (VTG_Position); nexLoop(nex_listen_list);
|
689 | p2_s0.addValue (0,VTG_Position); nexLoop(nex_listen_list);
|
690 | delay (100);
|
691 | }
|
692 |
|
693 | if (p==10){
|
694 | p2_n0.setValue (Kraftstoff_Druck); nexLoop(nex_listen_list);
|
695 | p2_s0.addValue (0,Kraftstoff_Druck); nexLoop(nex_listen_list);
|
696 | delay (100);
|
697 | }
|
698 |
|
699 | if (p==20){
|
700 | p20_n0.setValue (Thermoelement1); nexLoop(nex_listen_list);
|
701 | p20_n1.setValue (Thermoelement2); nexLoop(nex_listen_list);
|
702 | p20_n2.setValue (Thermoelement3); nexLoop(nex_listen_list);
|
703 | p20_n3.setValue (Thermoelement4); nexLoop(nex_listen_list);
|
704 |
|
705 | p20_s0.addValue (0,Thermoelement1/4); nexLoop(nex_listen_list);
|
706 | p20_s0.addValue (1,Thermoelement2/4); nexLoop(nex_listen_list);
|
707 | p20_s0.addValue (2,Thermoelement3/4); nexLoop(nex_listen_list);
|
708 | p20_s0.addValue (3,Thermoelement4/4); nexLoop(nex_listen_list);
|
709 | }
|
710 |
|
711 |
|
712 | if (p==21){
|
713 | p21_n0.setValue (Thermoelement1); nexLoop(nex_listen_list);
|
714 | p21_n1.setValue (Abgasdruck); nexLoop(nex_listen_list);
|
715 | p21_n2.setValue (Lambda); nexLoop(nex_listen_list);
|
716 |
|
717 | p21_s0.addValue (0,Thermoelement1/4); nexLoop(nex_listen_list);
|
718 | p21_s0.addValue (1,Abgasdruck); nexLoop(nex_listen_list);
|
719 | p21_s0.addValue (2,Lambda); nexLoop(nex_listen_list);
|
720 | }
|
721 |
|
722 | if (p==22){
|
723 | p22_n0.setValue (Ladedruck); nexLoop(nex_listen_list);
|
724 | p22_n1.setValue (Abgasdruck); nexLoop(nex_listen_list);
|
725 | p22_n2.setValue (Lambda); nexLoop(nex_listen_list);
|
726 |
|
727 | p22_s0.addValue (0,Ladedruck); nexLoop(nex_listen_list);
|
728 | p22_s0.addValue (1,Abgasdruck); nexLoop(nex_listen_list);
|
729 | p22_s0.addValue (2,Lambda); nexLoop(nex_listen_list);
|
730 | delay (100);
|
731 | }
|
732 |
|
733 | if (p==23){
|
734 | p23_n0.setValue (Ladedruck); nexLoop(nex_listen_list);delay (15);
|
735 | p23_n1.setValue (Saugrohrtemperatur); nexLoop(nex_listen_list);delay (15);
|
736 | p23_n2.setValue (Luftmasse); nexLoop(nex_listen_list);delay (15);
|
737 | p23_n3.setValue (Unterdruck_Ansaugung); nexLoop(nex_listen_list);
|
738 | delay (15);
|
739 | p23_s0.addValue (0,Ladedruck); nexLoop(nex_listen_list);
|
740 | delay (15);
|
741 | p23_s0.addValue (1,Saugrohrtemperatur); nexLoop(nex_listen_list);
|
742 | delay (15);
|
743 | p23_s0.addValue (2,Luftmasse); nexLoop(nex_listen_list);
|
744 | delay (15);
|
745 | p23_s0.addValue (3,Unterdruck_Ansaugung/2); nexLoop(nex_listen_list);
|
746 | delay (15);
|
747 | }
|
748 |
|
749 | if (p==24){
|
750 | p24_n0.setValue (Luftmasse); nexLoop(nex_listen_list);
|
751 | p24_n1.setValue (Abgasdruck); nexLoop(nex_listen_list);
|
752 | p24_n2.setValue (Ladedruck); nexLoop(nex_listen_list);
|
753 | p24_n3.setValue (Unterdruck_Ansaugung); nexLoop(nex_listen_list);
|
754 |
|
755 | p24_s0.addValue (0,Luftmasse); nexLoop(nex_listen_list);
|
756 | p24_s0.addValue (1,Abgasdruck); nexLoop(nex_listen_list);
|
757 | p24_s0.addValue (2,Ladedruck); nexLoop(nex_listen_list);
|
758 | p24_s0.addValue (3,Unterdruck_Ansaugung/2); nexLoop(nex_listen_list);
|
759 | delay (50);
|
760 | }
|
761 |
|
762 | if (p==30){
|
763 | }
|
764 |
|
765 |
|
766 | //_________________________________Dimmmen___________________________
|
767 |
|
768 | if (brightness1 ==1){
|
769 | if (brightness ==1){sendCommand("dims=10");}
|
770 | if (brightness ==2){sendCommand("dims=20");}
|
771 | if (brightness ==3){sendCommand("dims=30");}
|
772 | if (brightness ==4){sendCommand("dims=40");}
|
773 | if (brightness ==5){sendCommand("dims=50");}
|
774 | if (brightness ==6){sendCommand("dims=60");}
|
775 | if (brightness ==7){sendCommand("dims=70");}
|
776 | if (brightness ==8){sendCommand("dims=80");}
|
777 | if (brightness ==9){sendCommand("dims=90");}
|
778 | if (brightness ==10){sendCommand("dims=100"); }
|
779 | brightness1 = 0;
|
780 |
|
781 | }
|
782 | //__________________________Zykluszeit_______________________________________
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 | Serial.println (millis()-start); nexLoop(nex_listen_list);
|
790 |
|
791 | }
|