Hi,,
I have been trying to use this library with esp32 but no luck so far.. All I want to do is toggle some relays connected on the extender IC but while running the IC doesn't seem to respond..
The I2C scanner shows the address at 0x20.. and my SDA, SCL pins are connected to 21 and 22 respectively.. Not sure, what I am doing wrong.. code below..
#include "Arduino.h"#include "PCF8575.h"// Set i2c addressPCF8575 pcf8575(0x20);void setup() {Serial.begin(115200);// Set pinMode to OUTPUTfor(int i=0;i<8;i++) {pcf8575.pinMode(i, OUTPUT);}pcf8575.begin();}void loop(){static int pin = 0;pcf8575.digitalWrite(pin, HIGH);Serial.println("ON");delay(1000);pcf8575.digitalWrite(pin, LOW);Serial.println("OFF");delay(1000);pin++;if (pin > 7) pin = 0;}
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.