Skip to content

Commit fb05aec

Browse files
committed
Add the possibility to insert address at begin()
1 parent dac17ed commit fb05aec

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

PCF8574.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
181181

182182
}
183183

184+
bool PCF8574::begin(uint8_t address){
185+
_address = address;
186+
return PCF8574::begin();
187+
}
188+
189+
184190
/**
185191
* wake up i2c controller
186192
*/

PCF8574.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* PCF8574 GPIO Port Expand
33
*
44
* AUTHOR: Renzo Mischianti
5-
* VERSION: 2.3.6
5+
* VERSION: 2.3.7
66
*
77
* https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
88
*
@@ -125,6 +125,7 @@ class PCF8574 {
125125
#endif
126126

127127
bool begin();
128+
bool begin(uint8_t address);
128129
void pinMode(uint8_t pin, uint8_t mode, uint8_t output_start = HIGH);
129130

130131
void encoder(uint8_t pinA, uint8_t pinB);

PCF8574_library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* PCF8574 GPIO Port Expand
33
*
44
* AUTHOR: Renzo Mischianti
5-
* VERSION: 2.3.6
5+
* VERSION: 2.3.7
66
*
77
* https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
88
*

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#### If you need more pins [here](https://www.mischianti.org/2019/07/22/pcf8575-i2c-16-bit-digital-i-o-expander/) you can find the pcf8575 16bit version of the IC.
1919

2020
## Changelog
21+
- 01/02/2024: v2.3.7 Add the possibility to insert address at begin()
2122
- 10/07/2023: v2.3.6 Support for Arduino UNO R4
2223
- 08/02/2023: v2.3.5 Fix STM32 support and add support for Raspberry Pi Pico and other rp2040 boards
2324
- 10/08/2022: v2.3.4 Add support for custom SERCOM interface of Arduino SAMD devices. Force SDA SCL to use GPIO numeration for STM32 bug (https://www.mischianti.org/forums/topic/compatible-with-stm32duino/).

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PCF8574 library",
3-
"version": "2.3.6",
3+
"version": "2.3.7",
44
"keywords": "digital, i2c, encoder, expander, pcf8574, pcf8574a, esp32, esp8266, stm32, SAMD, Arduino, wire, rp2040, Raspberry",
55
"description": "Most starred PCF8574 library. i2c digital expander for Arduino, Raspberry Pi Pico and rp2040 boards, esp32, SMT32 and ESP8266. Can read write digital values with only 2 wire. Very simple to use and encoder support.",
66
"homepage": "https://www.mischianti.org/category/my-libraries/pcf8574/",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=PCF8574 library
2-
version=2.3.6
2+
version=2.3.7
33
author=Renzo Mischianti <[email protected]>
44
maintainer=Renzo Mischianti <[email protected]>
55
sentence=Most starred PCF8574 library for Arduino (standard and SAMD), Raspberry Pi Pico and rp2040 boards, ESP8266, smt32 and esp32

0 commit comments

Comments
 (0)