Closed Muhammad-Adnan-Ahmed closed 3 months 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);
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.
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
/*!
the PCF8574 I2C Expander / class Adafruit_PCF8574 { public: Adafruit_PCF8574(); bool begin(uint8_t i2c_addr = PCF8574_I2CADDR_DEFAULT, TwoWire wire = &Wire);
bool digitalWriteByte(uint8_t d); bool digitalWrite(uint8_t pinnum, bool val); uint8_t digitalReadByte(void); bool digitalRead(uint8_t pinnum); bool pinMode(uint8_t pinnum, uint8_t val);
private: uint8_t _readbuf = 0, _writebuf = 0;
Adafruit_I2CDevice *i2c_dev; };
endif