Hi there,
Trying use ESP8266-01 (ESP01) module along with a PCF8574T module with Adafruit library and few more, but failed.
tested with;
Anyone could suggest a PCF8574T library which would work with ESP01 module please?
#include <pcf8574_esp.h>
#include <ESP8266WiFi.h>
#include <Wire.h>
TwoWire testWire;
PCF857x pcf8574(0x20, &testWire);
void setup() {
WiFi.persistent(false);
WiFi.mode(WIFI_OFF);
WiFi.forceSleepBegin();
delay(1);
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
delay(1000);
Serial.println("serial connected!");
testWire.begin(0, 2);
testWire.setClock(100000L);
pcf8574.begin();
Serial.println("Found PCF8574");
delay(500);
// DO NOTE: When you write LOW to a pin on a PCF8574 it becomes an OUTPUT.
// It wouldn't generate an interrupt if you were to connect a button to it that pulls it HIGH when you press the button.
// Any pin you wish to use as input must be written HIGH and be pulled LOW to generate an interrupt.
digitalWrite(0, LOW);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
}
void loop() {
Serial.println("in the loop..");
digitalWrite(0, LOW);
delay(1000);
digitalWrite(0, HIGH);
digitalWrite(1, LOW);
delay(1000);
digitalWrite(1, HIGH);
digitalWrite(2, LOW);
delay(1000);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(3, HIGH);
}
serial monitor I see only the following, but none of the LEDs are blinking.
serial connected!
Found PCF8574
in the loop..
in the loop..
in the loop..
Thanks.