@@ -378,16 +378,18 @@ void Wippersnapper_AnalogIO::update() {
378
378
WS_DEBUG_PRINT (F (" Diff: " ));
379
379
WS_DEBUG_PRINTLN ((long )millis () - _analog_input_pins[i].prvPeriod );
380
380
381
- if (_analog_input_pins[i].prvPeriod == 0L ) {
382
- // last time was a clean event, passed hyteresis or 300ms had elapsed
383
- WS_DEBUG_PRINTLN (" prvPeriod is 0, last time was a clean event, "
384
- " passed hyteresis or 500ms had elapsed" );
385
- } else {
386
- // We're waiting 300ms before posting, to avoid a flood of events
387
- WS_DEBUG_PRINTLN (
388
- " prvPeriod is not 0, probably waiting 300ms before posting, "
389
- " to avoid a flood of events" );
390
- }
381
+ // if (_analog_input_pins[i].prvPeriod == 0L) {
382
+ // // last time was a clean event, passed hyteresis or 300ms had elapsed
383
+ // WS_DEBUG_PRINTLN("prvPeriod is 0, last time was a clean event, "
384
+ // "passed hyteresis or 500ms had elapsed");
385
+ // } else {
386
+ // // We're waiting 300ms before posting, to avoid a flood of events
387
+ // WS_DEBUG_PRINTLN(
388
+ // "prvPeriod is not 0, probably waiting 300ms before posting, "
389
+ // "to avoid a flood of events");
390
+ // }
391
+
392
+
391
393
// note: on-change requires ADC DEFAULT_HYSTERISIS to check against prv
392
394
// pin value
393
395
uint16_t pinValRaw = getPinValue (_analog_input_pins[i].pinName );
@@ -401,14 +403,14 @@ void Wippersnapper_AnalogIO::update() {
401
403
WS_DEBUG_PRINT (F (" \t CurrentLogValue: " ));
402
404
WS_DEBUG_PRINT (currentLogValue);
403
405
WS_DEBUG_PRINT (F (" \t LastLogValue: " ));
404
- WS_DEBUG_PRINTLN (lastLogValue);
406
+ WS_DEBUG_PRINT (lastLogValue);
405
407
bool passed_hysterisys = false ;
406
408
// Check if the logarithmic change exceeds the threshold
407
409
if (abs (currentLogValue - lastLogValue) > DEFAULT_HYSTERISIS) {
408
410
passed_hysterisys = true ;
409
- WS_DEBUG_PRINTLN (F (" ADC passed hysteresis" ));
411
+ WS_DEBUG_PRINTLN (F (" \t ADC passed hysteresis" ));
410
412
} else {
411
- WS_DEBUG_PRINTLN (F (" ADC did not pass hysteresis" ));
413
+ WS_DEBUG_PRINTLN (F (" \t ADC did not pass hysteresis" ));
412
414
}
413
415
414
416
// old technique
@@ -419,15 +421,15 @@ void Wippersnapper_AnalogIO::update() {
419
421
_analog_input_pins[i].prvPinVal -
420
422
(_analog_input_pins[i].prvPinVal * DEFAULT_HYSTERISIS);
421
423
WS_DEBUG_PRINT (F (" PinValThreshHi: " ));
422
- WS_DEBUG_PRINTLN (_pinValThreshHi);
424
+ WS_DEBUG_PRINT (_pinValThreshHi);
423
425
WS_DEBUG_PRINT (F (" PinValThreshLow: " ));
424
- WS_DEBUG_PRINTLN (_pinValThreshLow);
426
+ WS_DEBUG_PRINT (_pinValThreshLow);
425
427
426
428
if (pinValRaw > _pinValThreshHi || pinValRaw < _pinValThreshLow) {
427
429
// passed_hysterisys = true;
428
- WS_DEBUG_PRINTLN (F (" ADC passed OLD hysteresis" ));
430
+ WS_DEBUG_PRINTLN (F (" \t ADC passed OLD hysteresis" ));
429
431
} else {
430
- WS_DEBUG_PRINTLN (F (" ADC did not pass OLD hysteresis" ));
432
+ WS_DEBUG_PRINTLN (F (" \t ADC did not pass OLD hysteresis" ));
431
433
}
432
434
433
435
if (_analog_input_pins[i].readMode ==
0 commit comments