mirror of
https://github.com/Eigenbaukombinat/ebk_co2ampel.git
synced 2024-11-24 15:20:20 +01:00
more debug output via serial, interval 15s, custom font inclusion
This commit is contained in:
parent
ec3ecb4abd
commit
314a39619e
1 changed files with 9 additions and 3 deletions
|
@ -2,13 +2,14 @@
|
|||
#include "MHZ19.h"
|
||||
#include "SSD1306Wire.h"
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include "fonts-custom.h"
|
||||
|
||||
// Maximum CO² levels for green and yellow, everything above is considered red.
|
||||
#define GREEN_CO2 800
|
||||
#define YELLOW_CO2 1000
|
||||
|
||||
// Measurement interval in miliseconds
|
||||
#define INTERVAL 60000
|
||||
#define INTERVAL 15000
|
||||
|
||||
// Pins for MH-Z19
|
||||
#define RX_PIN 16
|
||||
|
@ -24,6 +25,7 @@
|
|||
// number of LEDs connected
|
||||
#define NUMPIXELS 12
|
||||
|
||||
|
||||
MHZ19 myMHZ19;
|
||||
HardwareSerial mySerial(1);
|
||||
SSD1306Wire display(0x3c, SDA_PIN, SCL_PIN);
|
||||
|
@ -32,9 +34,11 @@ Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, LED_PIN, NEO_RGB + NEO_K
|
|||
unsigned long getDataTimer = 0;
|
||||
int lastvals[120];
|
||||
int dheight;
|
||||
|
||||
String ampelversion = "smash20201117-01";
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("boot...");
|
||||
Serial.println(ampelversion);
|
||||
mySerial.begin(9600, SERIAL_8N1, RX_PIN, TX_PIN);
|
||||
myMHZ19.begin(mySerial);
|
||||
pixels.clear();
|
||||
|
@ -114,7 +118,9 @@ void loop() {
|
|||
display.display();
|
||||
// Debug output
|
||||
Serial.print("CO2 (ppm): ");
|
||||
Serial.println(CO2);
|
||||
Serial.print(CO2);
|
||||
Serial.print(" uptime (seconds): ");
|
||||
Serial.println(millis()/1000);
|
||||
getDataTimer = millis();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue