#include <PCF8574.h>
PCF8574 pcf20(0x27);
void setup() {
Serial.begin(115200);
delay(500);
// Serial.print("PCF8574_LIB_VERSION:\t");
// Serial.println(PCF8574_LIB_VERSION);
if (!pcf20.begin()) {
Serial.println("Chip not responding.");
}
if (!pcf20.isConnected()) {
Serial.println("could not initialize... => not connected");
while (1);
}
for (uint8_t i = 0; i < 3; i++) {
pcf20.write8(255);
delay(100);
pcf20.write8(0);
delay(200);
}
delay(800);
/*
pcf20.write(0, 1);
delay(300);
pcf20.write(2, 1);
delay(300);
pcf20.write(7, 1);
delay(2000);
pcf20.write(0, 0);
delay(300);
pcf20.write(2, 0);
delay(300);
pcf20.write(7, 0);
delay(2000);
*/
pcf20.write(0, 1);
delay(125);
}
void loop() {
for (int i = 0; i < 7; i++) {
pcf20.shiftLeft();
delay(125);
}
for (int i = 0; i < 7; i++) {
pcf20.shiftRight();
delay(125);
}
delay(1);
}