mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-16 02:02:11 +02:00
Add parameter tvoc_raw
for SGP41
This commit is contained in:
@ -57,7 +57,7 @@ enum {
|
||||
APP_SM_WIFI_MANAGER_STA_CONNECTED, /** Connecting to WiFi worked */
|
||||
APP_SM_WIFI_OK_SERVER_CONNECTING, /** Once connected to WiFi an attempt to
|
||||
reach the server is performed */
|
||||
APP_SM_WIFI_OK_SERVER_CONNECTED, /** Server is reachable, all fine */
|
||||
APP_SM_WIFI_OK_SERVER_CONNECTED, /** Server is reachable, all fine */
|
||||
/** Exceptions during WIFi Setup */
|
||||
APP_SM_WIFI_MANAGER_CONNECT_FAILED, /** Cannot connect to WiFi (e.g. wrong
|
||||
password, WPA Enterprise etc.) */
|
||||
@ -408,6 +408,7 @@ static bool wifiHasConfig = false;
|
||||
static String wifiSSID = "";
|
||||
|
||||
int tvocIndex = -1;
|
||||
int tvocRawIndex = -1;
|
||||
int noxIndex = -1;
|
||||
int co2Ppm = 0;
|
||||
|
||||
@ -554,6 +555,9 @@ static void sendDataToServer(void) {
|
||||
if (tvocIndex > 0) {
|
||||
root["tvoc_index"] = loopCount;
|
||||
}
|
||||
if (tvocRawIndex >= 0) {
|
||||
root["tvoc_raw"] = tvocRawIndex;
|
||||
}
|
||||
if (noxIndex > 0) {
|
||||
root["nox_index"] = loopCount;
|
||||
}
|
||||
@ -769,10 +773,12 @@ static void updateWiFiConnect(void) {
|
||||
*/
|
||||
static void tvocPoll(void) {
|
||||
tvocIndex = ag.sgp41.getTvocIndex();
|
||||
tvocRawIndex = ag.sgp41.getTvocRaw();
|
||||
noxIndex = ag.sgp41.getNoxIndex();
|
||||
|
||||
Serial.printf("tvocIndexindex: %d\r\n", tvocIndex);
|
||||
Serial.printf(" NOx index: %d\r\n", noxIndex);
|
||||
Serial.printf(" TVOC index: %d\r\n", tvocIndex);
|
||||
Serial.printf("TVOC raw index: %d\r\n", tvocRawIndex);
|
||||
Serial.printf(" NOx index: %d\r\n", noxIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user