OpenSprinkler Forums OpenSprinkler Unified Firmware ESP8266 Use native GPIOs Reply To: ESP8266 Use native GPIOs

#72009

Ray
Keymaster

The expander has never used PCF8574 because it only has 8 channels and expanders have always had 16 channels. The first version of OpenSprinkler used two PCF8574s on the main controller, one on the top board and one on the bottom/driver board. The bottom/driver board is not expander.

The code that handles expander is here:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/2b293a1c8712a05a95799bb3efa290ff771f4f46/OpenSprinkler.cpp#L1131
because it uses dynamic typing (i.e. expander[i] itself carries the type of the I2C chip), you will have to modify code in gpio.cpp:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/gpio.cpp#L118
the simplest hack is to remove the second Wire.write:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/gpio.cpp#L123
see if it works for your PCF8574.