i have salvaged a couple pcf8574's from some lcd's. I downloaded library RobTillaart/PCF8574
I cant seem to get write8() to work properly. if seems if i use write8(1) or write8(HIGH) the pins just stay low but i can write8(0) and it seems to work.
Here is my code. it currently dont work. however if i uncomment the single write and get rid of write8(HIGH) the code works?
Any idea why i experience this behavior?
#include "PCF8574.h"
PCF8574 PCF(0x27, &Wire);
void setup()
{
Serial.begin(115200);
if (!PCF.begin(D2, D1, HIGH))
{
Serial.println("could not initialize...");
}
if (!PCF.isConnected())
{
Serial.println("=> not connected");
while (1);
}
}
void loop() {
PCF.write8(HIGH);
// PCF.write(0, 1);
// PCF.write(1, 1);
// PCF.write(2, 1);
// PCF.write(3, 1);
// PCF.write(4, 1);
// PCF.write(5, 1);
// PCF.write(6, 1);
// PCF.write(7, 1);
delay(1000);
PCF.write8(LOW);
delay(1000);
}