From 514ba0aac62ea6a67a179d89d33b2a787ddaa4d5 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Fri, 26 Jul 2019 13:58:02 +0200 Subject: [PATCH] sds custom period --- src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f7e9832..0307a77 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -232,7 +232,15 @@ void setup() } sds.begin(); - sds_active = true; // ToDo + + FirmwareVersionResult sds_fw = sds.queryFirmwareVersion(); + if (sds_fw.isOk()) { + sds_active = true; + sds.setActiveReportingMode(); // ensures sensor is in 'active' reporting mode + sds.setCustomWorkingPeriod(5); // sensor sends data every 3 minutes + } else { + Serial.println("Failed to communicate with SDS011 sensor, check wiring?"); + } display.clearScreen(); display.refresh();