This commit is contained in:
J. Nick Koston 2023-06-05 16:37:14 -05:00
parent 886d4611b0
commit c783dbd680
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -378,14 +378,14 @@ namespace ratgdo {
// Every 50ms
if (currentMillis - lastMillis > 50) {
// check to see if we got between 3 and 8 low pulses on the line
if (this->obstructionLowCount >= 3 && this->obstructionLowCount <= 8) {
if (arg->store_.obstructionLowCount >= 3 && arg->store_.obstructionLowCount <= 8) {
obstructionCleared();
// if there have been no pulses the line is steady high or low
} else if (this->obstructionLowCount == 0) {
// if the line is high and the last high pulse was more than 70ms ago,
// then there is an obstruction present
if (this->input_obst_pin_->digital_read() && currentMillis - this->lastObstructionHigh > 70) {
if (this->input_obst_pin_->digital_read() && currentMillis - arg->store_.lastObstructionHigh > 70) {
obstructionDetected();
} else {
// asleep