diff options
Diffstat (limited to 'main.ino')
-rw-r--r-- | main.ino | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -4,6 +4,7 @@ #include "data.h" #include "battery.h" #include "display.h" +#include "datalog.h" #include "co2.h" #include "pm.h" @@ -14,6 +15,7 @@ CO2 co2; SensorData data; Display display; +DataLog datalog; void setup() { Serial.begin(115200); @@ -27,6 +29,10 @@ void setup() { display.start(); display.show(&data); + // I think this has to come after the display.start(), they may both + // use the same SPI thing + datalog.start(); + battery.start(); co2.start(); pm.start(); @@ -42,7 +48,10 @@ void loop() { if (pm.dataReady()) { changed = true; pm.read(&data); } if (co2.dataReady()) { changed = true; co2.read(&data); } - if (changed) display.show(&data); - + if (changed) { + display.show(&data); + datalog.show(&data); + } + delay(5000); } |