ADC pin reading (#106)

* ADC pin reading

#95

* arduino and always flag correction

* optimize sram use and remove adc sensor option per default

* integrate a threshold
This commit is contained in:
Florian authored and GitHub committed 2017-09-28 22:43:12 +02:00
1 parent d7ebd123d1
commit c915ddfa48
4 files changed
+110 -7

No files matched your search

+10 -7
View File
@@ -134,21 +134,21 @@ void setup()
ArduinoOTA.setPassword(ota_password);
ArduinoOTA.onStart([]() {
Serial.println("Start");
trc(F("Start"));
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
trc(F("\nEnd"));
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
if (error == OTA_AUTH_ERROR) trc(F("Auth Failed"));
else if (error == OTA_BEGIN_ERROR) trc(F("Begin Failed"));
else if (error == OTA_CONNECT_ERROR) trc(F("Connect Failed"));
else if (error == OTA_RECEIVE_ERROR) trc(F("Receive Failed"));
else if (error == OTA_END_ERROR) trc(F("End Failed"));
});
ArduinoOTA.begin();
#else
@@ -247,6 +247,9 @@ void loop()
#ifdef ZsensorDHT
MeasureTempAndHum(); //Addon to measure the temperature with a DHT
#endif
#ifdef ZsensorADC
MeasureADC(); //Addon to measure the analog value of analog pin
#endif
// Receive loop, if data received by RF433 or IR send it by MQTT
#ifdef ZgatewayRF
boolean resultRF = RFtoMQTT();