@@ -371,13 +371,6 @@ void Wippersnapper_AnalogIO::update() {
371
371
// Does the pin execute on_change?
372
372
else if (_analog_input_pins[i].period == 0L ) {
373
373
374
- WS_DEBUG_PRINT (F (" CurrentTime: " ));
375
- WS_DEBUG_PRINTLN (millis ());
376
- WS_DEBUG_PRINT (F (" PrvPeriod: " ));
377
- WS_DEBUG_PRINTLN (_analog_input_pins[i].prvPeriod );
378
- WS_DEBUG_PRINT (F (" Diff: " ));
379
- WS_DEBUG_PRINTLN ((long )millis () - _analog_input_pins[i].prvPeriod );
380
-
381
374
// if (_analog_input_pins[i].prvPeriod == 0L) {
382
375
// // last time was a clean event, passed hyteresis or 300ms had elapsed
383
376
// WS_DEBUG_PRINTLN("prvPeriod is 0, last time was a clean event, "
@@ -454,9 +447,7 @@ void Wippersnapper_AnalogIO::update() {
454
447
// waiting 200ms before posting the next final movement event (or
455
448
// continued movement events), to avoid a flood of events when twisting
456
449
// pots
457
- if (passed_hysterisys &&
458
- (((long )millis () - _analog_input_pins[i].prvPeriod ) > 200 ||
459
- _analog_input_pins[i].prvPeriod == 0L )) {
450
+ if (passed_hysterisys && ((long )millis () - _analog_input_pins[i].prvPeriod ) > 200 ) {
460
451
WS_DEBUG_PRINTLN (F (" ADC has changed enough, publishing event..." ));
461
452
_analog_input_pins[i].prvPinVal = pinValRaw;
462
453
_analog_input_pins[i].prvPeriod = millis ();
0 commit comments