xreef / PCF8574_library

PCF8574 library. i2c digital expander for Arduino, Raspberry Pi Pico and rp2040 boards, esp32, SMT32 and ESP8266. Can read write digital values with only 2 wire. Very simple to use and encoder support.
Other
214 stars 62 forks source link

OUTPUT SET TO HIGH DURING BEGIN #65

Closed edg2411 closed 1 year ago

edg2411 commented 1 year ago

Hello Im having an issue as it says in the title is there any reason why even though I set the output to low before calling begin() during the begin function it drives the input to high and I need to set it back to low after begin ends. The only thing that may be different from an example from your library is that Im also using an RTC but I dont think that have something to do with my issue. Thanks in advance and great library btw!

xreef commented 1 year ago

Hi edg, How do you declare the pin INPUT?? Bye Renzo

edg2411 commented 1 year ago

It is an output, ` for(int i=0;i<8;i++) { pcf8574.pinMode(i, OUTPUT); } pcf8574.pinMode(P2, OUTPUT); pcf8574.pinMode(P1, INPUT_PULLUP); pcf8574.pinMode(P0, INPUT_PULLUP); pcf8574.digitalWrite(P2, LOW)

serialMonitor.sendStatusMessage("Init pcf8574..."); if (pcf8574.begin()){ serialMonitor.sendStatusMessage("OK\n"); } else { serialMonitor.sendStatusMessage("KO\n"); } pcf8574.digitalWrite(P2, LOW);`

it start low during begin at some point the output is set to high and if I dont drive it low again it stays high

xreef commented 1 year ago

Hi, read the documentation here. Bye Renzo