From 0d1076597e72731f7c81c78b59a1433550c39e4c Mon Sep 17 00:00:00 2001 From: Jean-Marc Guazzo Date: Sat, 17 Jan 2026 09:38:33 -0500 Subject: [PATCH 1/2] set transmissionStatus on digitalRead --- PCF8574.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PCF8574.cpp b/PCF8574.cpp index 30089d5..377a687 100644 --- a/PCF8574.cpp +++ b/PCF8574.cpp @@ -965,7 +965,8 @@ uint8_t PCF8574::digitalRead(uint8_t pin, bool forceReadNow){ // }else if (forceReadNow || (millis() > PCF8574::lastReadMillis+latency)){ }else if (forceReadNow || (millis() - PCF8574::lastReadMillis > latency)){ PCF8574_DEBUG_PRINT(" ...Read from buffer... "); - _wire->requestFrom(_address,(uint8_t)1);// Begin transmission to PCF8574 with the buttons + uint8_t bytesRead = _wire->requestFrom(_address, (uint8_t)1); // Begin transmission to PCF8574 with the buttons + this->transmissionStatus = (bytesRead == 1) ? 0 : 1; lastReadMillis = millis(); if(_wire->available()) // If bytes are available to be recieved { From 99a17590cc2fe445c0815d4299aed25477278d88 Mon Sep 17 00:00:00 2001 From: Jean-Marc Guazzo Date: Sat, 17 Jan 2026 10:26:38 -0500 Subject: [PATCH 2/2] return 4 "other error" --- PCF8574.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCF8574.cpp b/PCF8574.cpp index 377a687..4459bd8 100644 --- a/PCF8574.cpp +++ b/PCF8574.cpp @@ -966,7 +966,7 @@ uint8_t PCF8574::digitalRead(uint8_t pin, bool forceReadNow){ }else if (forceReadNow || (millis() - PCF8574::lastReadMillis > latency)){ PCF8574_DEBUG_PRINT(" ...Read from buffer... "); uint8_t bytesRead = _wire->requestFrom(_address, (uint8_t)1); // Begin transmission to PCF8574 with the buttons - this->transmissionStatus = (bytesRead == 1) ? 0 : 1; + this->transmissionStatus = (bytesRead != 0) ? 0 : 4; // return "Other error" similar from endTransmission lastReadMillis = millis(); if(_wire->available()) // If bytes are available to be recieved {