Reading Pcf8574 as pins rather than 8 bit word
Posted: Fri Apr 05, 2024 7:11 am
I have a project that already makes use of the components from Unclerus, including the hd44780 for driving an LCD display.
I need to expand my Gpio ports so I've added a discrete pcf8574 board in. Now I already have the includes in my project as it's part of the lcd setup. I can happily read from the new pcf8574 board. Sounds great? Not really.
I seem to only be able to read or write to the pcf8574 as an 8 bit word, effectively using it as an 8 bit parallel port. What I'd like to be able to do is read each pin individually at any point, but they don't seem to be addressable.
Any help? Many thanks. Link to the unclerus lib below.
https://github.com/UncleRus/esp-idf-lib ... ts/pcf8574
I need to expand my Gpio ports so I've added a discrete pcf8574 board in. Now I already have the includes in my project as it's part of the lcd setup. I can happily read from the new pcf8574 board. Sounds great? Not really.
I seem to only be able to read or write to the pcf8574 as an 8 bit word, effectively using it as an 8 bit parallel port. What I'd like to be able to do is read each pin individually at any point, but they don't seem to be addressable.
Any help? Many thanks. Link to the unclerus lib below.
https://github.com/UncleRus/esp-idf-lib ... ts/pcf8574