Lean on Arduino log library instead of custom logging methods (#546)
* Lean on Arduino log library instead of custom logging methods
This commit is contained in:
1 parent
824346b19c
commit
f3c9d6dd90
28 files changed
+557
-745
No files matched your search
+7
-2
@@ -37,6 +37,11 @@ ADC_MODE(ADC_TOUT);
|
||||
//Time used to wait for an interval before resending adc value
|
||||
unsigned long timeadc = 0;
|
||||
|
||||
void setupADC()
|
||||
{
|
||||
Log.notice(F("Reading ADC on pin: %d" CR), ADC_PIN);
|
||||
}
|
||||
|
||||
void MeasureADC()
|
||||
{
|
||||
if (millis() > (timeadc + TimeBetweenReadingADC))
|
||||
@@ -49,13 +54,13 @@ void MeasureADC()
|
||||
int val = analogRead(ADC_PIN);
|
||||
if (isnan(val))
|
||||
{
|
||||
trc(F("Failed to read from ADC !"));
|
||||
Log.error(F("Failed to read from ADC !" CR));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (val >= persistedadc + ThresholdReadingADC || val <= persistedadc - ThresholdReadingADC)
|
||||
{
|
||||
trc(F("Creating ADC buffer"));
|
||||
Log.trace(F("Creating ADC buffer" CR));
|
||||
const int JSON_MSG_CALC_BUFFER = JSON_OBJECT_SIZE(1);
|
||||
StaticJsonBuffer<JSON_MSG_CALC_BUFFER> jsonBuffer;
|
||||
JsonObject &ADCdata = jsonBuffer.createObject();
|
||||
|
||||
Reference in new issue
Block a user