mirror of
https://github.com/Eigenbaukombinat/ebk_co2ampel.git
synced 2024-12-29 14:33:07 +01:00
changed led bus to 800MHz
This commit is contained in:
parent
5db4907a1d
commit
e0adccce94
1 changed files with 3 additions and 6 deletions
|
@ -22,12 +22,12 @@
|
|||
#define LED_PIN 4
|
||||
|
||||
// number of LEDs connected
|
||||
#define NUMPIXELS 12
|
||||
#define NUMPIXELS 8
|
||||
|
||||
MHZ19 myMHZ19;
|
||||
HardwareSerial mySerial(1);
|
||||
SSD1306Wire display(0x3c, SDA_PIN, SCL_PIN);
|
||||
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, LED_PIN, NEO_RGB + NEO_KHZ400);
|
||||
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, LED_PIN, NEO_RGB + NEO_KHZ800);
|
||||
|
||||
unsigned long getDataTimer = 0;
|
||||
int lastvals[120];
|
||||
|
@ -52,7 +52,7 @@ void setup() {
|
|||
|
||||
pixels.begin();
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, pixels.Color(0, 0, 50));
|
||||
pixels.setPixelColor(i, 0,0,50);
|
||||
pixels.show();
|
||||
}
|
||||
}
|
||||
|
@ -66,19 +66,16 @@ void set_led_color(int co2) {
|
|||
// Green
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, 30,0,0);
|
||||
pixels.show();
|
||||
}
|
||||
} else if (co2 < YELLOW_CO2) {
|
||||
// Yellow
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, 40,40,0);
|
||||
pixels.show();
|
||||
}
|
||||
} else {
|
||||
// Red
|
||||
for(int i=0; i<NUMPIXELS; i++) {
|
||||
pixels.setPixelColor(i, 0,90,0);
|
||||
pixels.show();
|
||||
}
|
||||
}
|
||||
pixels.show();
|
||||
|
|
Loading…
Reference in a new issue