Home › Forums › The libraries hosted on the site › PCF8574 i2c digital I/O expander › Add functionality to check if device is connected properly. › Reply To: Add functionality to check if device is connected properly.
4 June 2020 at 07:46
#4385
Hi Michiel
now It’s possible to check the status with
if (pcf8574.begin()){
Serial.println("pcf8574 started!");
}else{
Serial.println("pcf8574 not started!");
}
or
if (pcf8574.digitalWrite(P7, startVal)){
Serial.println("Write ok");
}else{
Serial.println("Write not ok");
}
It’s also possible to get last writeStatus with
uint8_t getTransmissionStatusCode() const {
return transmissionStatus;
}
bool isLastTransmissionSuccess(){
return transmissionStatus==0;
}
Bye Renzo