Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By forlotto
#50619 Cool Expansion Board Check This Out

The board above uses the chip you talk of and is easily expandable and linkable check it out pretty cool design really.

Hrmmm bummer is I have a bunch of shift registers now ....

Oh well such is life I'll have to look into things a bit weigh my options.
User avatar
By trackerj
#50622
forlotto wrote:Cool Expansion Board Check This Out

The board above uses the chip you talk of and is easily expandable and linkable check it out pretty cool design really.

Hrmmm bummer is I have a bunch of shift registers now ....

Oh well such is life I'll have to look into things a bit weigh my options.


Yep, that's a nice & simple PCF8574 8Bit I/O port expander.
AN-1 is a bit more complex with 0-40V input autorange 18Bit ADC, 4 x 12 bit DAC, temperature sensor AND PCF8574 8Bit I/O port expander :)

If you look for a 16bit I/O port expander only, like the one from the PCF8575 example link, drop me a line.
User avatar
By Cicero
#50634 I wouldn't just discount the HC595's - they're useful for sure.

Dirt cheap, simple, edge triggered so no timing worries, cascadable for even more outputs. Combine them with a bunch of HC165's and you have more than enough IO's.
User avatar
By forlotto
#50827 excellent well I ordered that board and got it in the mail anyways so now I have both of them that I can hopefully figure out how to use the only issue is I need to figure out how to use it with basic :P

PCF8574_ESP

This is a simple library for using the PCF8574/PCF8574A I/O - expanders over I2C. I took the code by Rob Tillaart from http://playground.arduino.cc/Main/PCF8574Class and modified it to allow the use of I2C on non-default pins and/or using a TwoWire - class of your own instead of the default "Wire" as defined in Wire.h.

This library does not supply any special handling for using the interrupt - pin on the PCF8574, just connect the pin to a pin on your ESP, set up an interrupt-handler for it and remember to use pinMode(pin, INPUT_PULLUP) to make use of it.
Usage

class initializer PCF8574(uint8_t address, int sda = SDA, int scl = SCL, TwoWire UseWire = Wire)
uint8_t read8()
uint8_t read(uint8_t pin)
uint8_t value()
void write8(uint8_t value)
void write(uint8_t pin, uint8_t value)
void toggle(uint8_t pin)
void shiftRight(uint8_t n=1)
void shiftLeft(uint8_t n=1)
int lastError()

Mixing INPUT- and OUTPUT-pins and write8

Due to the way the PCF8574 works you cannot just use read8() to read the pin-states, then change one pin and write8() the new states out because if you are using some pins as INPUT and the pin is being pulled low the moment you read8() its state you'll then be pulling the pin LOW when issuing write8() and it'll stop working as an INPUT. For this reason the library caches written values instead of relying on reading the pin-states when using write() or toggle(), and if you use write8() in your own code you need to remember to pull HIGH any pin you want to use as INPUT regardless of their current state.

https://github.com/WereCatf/PCF8574_ESP.git