-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelligkeit.ino
73 lines (65 loc) · 1.16 KB
/
helligkeit.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
void helligkeit() {
if (aktuellertimer - messtimer > timerinterval) {
messtimer = millis();
if (hellmodus == 0) { // keine messung auf manuellem modus (1)
luxSensor = lightMeter.readLightLevel();
}
}
lux = luxSensor;
lux = map(lux, 0, 10, 40, 255);
if (lux > 255) {
lux = 255;
}
if (hellmodus == 0) {
strip.SetBrightness(lux);
strip.Show();
}
if (hellmodus == 1) {
if ( aktivmenu == 1) {
setlux();
menuanzeigeM();
}
strip.SetBrightness(luxkorr);
strip.Show();
}
}
void heller() {
menutimer = millis();
clearDot();
if (luxstufe <= 4) {
luxstufe = luxstufe + 1;
}
menuanzeigeM();
setlux();
}
void dunkler() {
menutimer = millis();
clearDot();
if (luxstufe >= 2) {
luxstufe = luxstufe - 1;
}
setlux();
menuanzeigeM();
}
void setlux() { //manuell
switch (luxstufe) {
case 1 :
luxkorr = 30;
break;
case 2 :
luxkorr = 60;
break;
case 3 :
luxkorr = 100;
break;
case 4 :
luxkorr = 150;
break;
case 5 :
luxkorr = 255;
break;
default:
luxkorr = 30;
break;
}
}