- Jun 6, 2020
- 11,559
- 4,422
it is a wrapper for PCF8574 based of arduino library from
functions are similar to original library, except initialization adapted to B4R.
It can work on Wire, Wire1 or Wire2, on hard I2C and on software I2C and we can have several 8574 on same I2C
with
## initialization
- Initialize(deviceAddress) // for all board with default I2C
- Initializeesp32(deviceAddress, I2Cbus) //only for esp32
device address: for PCF8574 : 0x20 to 0x27 for PCF8574A : 0x38 to 0x3F
I2Cbus can be define with a parameter provided by library :Wire or Wire1 or Wire2 (Wire by default)
- begin(initB) // set the initial value for the pins and masks.
- beginesp(sda, scl, initB) // only for esp8266 and esp32 to change pins
- isConnected() // checks if the address is visible on the I2C bus
### Read and Write
- **read8()** reads all 8 pins at once. This one does the actual reading.
- **read(pin)** reads a single pin; pin = 0..7...
برای دیدن لینک ها باید ثبت نام کنید
functions are similar to original library, except initialization adapted to B4R.
It can work on Wire, Wire1 or Wire2, on hard I2C and on software I2C and we can have several 8574 on same I2C
with
## initialization
- Initialize(deviceAddress) // for all board with default I2C
- Initializeesp32(deviceAddress, I2Cbus) //only for esp32
device address: for PCF8574 : 0x20 to 0x27 for PCF8574A : 0x38 to 0x3F
I2Cbus can be define with a parameter provided by library :Wire or Wire1 or Wire2 (Wire by default)
- begin(initB) // set the initial value for the pins and masks.
- beginesp(sda, scl, initB) // only for esp8266 and esp32 to change pins
- isConnected() // checks if the address is visible on the I2C bus
### Read and Write
- **read8()** reads all 8 pins at once. This one does the actual reading.
- **read(pin)** reads a single pin; pin = 0..7...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید