xreef/PCF8575_library

digitalReadAll

Le-Ze opened this issue · 1 comments

Le-Ze commented

Hi.
Why doesn't it work?
Am I making a mistake somewhere?

void loop()
{
pcf8575.digitalWrite(P10, HIGH);
int p10Digital = pcf8575.digitalRead(P10);
Serial.println(p10Digital);
PCF8575::DigitalInput di = pcf8575.digitalReadAll();
Serial.print(di.p10);
Serial.print(" - ");
Serial.print(di.p11);
Serial.print(" - ");
Serial.print(di.p12);
Serial.print(" - ");
Serial.println(di.p13);
delay(5000);
//---------------------------------------------------
pcf8575.digitalWrite(P10, LOW);
int p10Digital1 = pcf8575.digitalRead(P10);
Serial.println(p10Digital1);
PCF8575::DigitalInput di1 = pcf8575.digitalReadAll();
Serial.print(di1.p10);
Serial.print(" - ");
Serial.print(di1.p11);
Serial.print(" - ");
Serial.print(di1.p12);
Serial.print(" - ");
Serial.println(di1.p13);
delay(5000);
}

ser.monitor
1
0 - 0 - 0 - 0
0
0 - 0 - 0 - 0
1
0 - 0 - 0 - 0
0
0 - 0 - 0 - 0
1
0 - 0 - 0 - 0
0
0 - 0 - 0 - 0
1
0 - 0 - 0 - 0
0
0 - 0 - 0 - 0
1

They need to write the status P10 - P17 via the ser.monitor 00000000

xreef commented

Hi,
It seems ok, there is an internal buffer that is resetted when the value is read, and is set when the value change.
Bye Renso