adafruit / Adafruit_PCF8574

Arduino library for Adafruit PCF8574 & PCF8575 GPIO expander
Other
10 stars 9 forks source link

PCF85714.h #5

Closed Muhammad-Adnan-Ahmed closed 3 months ago

Muhammad-Adnan-Ahmed commented 1 year ago

PC85714. h contain only one I/O extender address. How could be add more I/O extender with header file. Please guide.

ifndef _ADAFRUIT_PCF8574_H

define _ADAFRUIT_PCF8574_H

include "Arduino.h"

include

include

define PCF8574_I2CADDR_DEFAULT 0x20

/*!

private: uint8_t _readbuf = 0, _writebuf = 0;

Adafruit_I2CDevice *i2c_dev; };

endif

caternuson commented 1 year ago

That is just defining a default address. For any other address, pass it in when calling begin: https://github.com/adafruit/Adafruit_PCF8574/blob/d6588ad29a11db8cd3119b243d7c1ba6da2f0cca/Adafruit_PCF8574.h#L33

Ex:

pcf.begin(0x21);
caternuson commented 3 months ago

Closing. The above post should be the answer. If there was more to the issue, please provide more details and the issue can be reopened.