Skip to content

Commit

Permalink
Add the possibility to insert address at begin()
Browse files Browse the repository at this point in the history
  • Loading branch information
xreef committed Feb 1, 2024
1 parent dac17ed commit fb05aec
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions PCF8574.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio

}

bool PCF8574::begin(uint8_t address){
_address = address;
return PCF8574::begin();
}


/**
* wake up i2c controller
*/
Expand Down
3 changes: 2 additions & 1 deletion PCF8574.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* PCF8574 GPIO Port Expand
*
* AUTHOR: Renzo Mischianti
* VERSION: 2.3.6
* VERSION: 2.3.7
*
* https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*
Expand Down Expand Up @@ -125,6 +125,7 @@ class PCF8574 {
#endif

bool begin();
bool begin(uint8_t address);
void pinMode(uint8_t pin, uint8_t mode, uint8_t output_start = HIGH);

void encoder(uint8_t pinA, uint8_t pinB);
Expand Down
2 changes: 1 addition & 1 deletion PCF8574_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* PCF8574 GPIO Port Expand
*
* AUTHOR: Renzo Mischianti
* VERSION: 2.3.6
* VERSION: 2.3.7
*
* https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#### 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.

## Changelog
- 01/02/2024: v2.3.7 Add the possibility to insert address at begin()
- 10/07/2023: v2.3.6 Support for Arduino UNO R4
- 08/02/2023: v2.3.5 Fix STM32 support and add support for Raspberry Pi Pico and other rp2040 boards
- 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/).
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PCF8574 library",
"version": "2.3.6",
"version": "2.3.7",
"keywords": "digital, i2c, encoder, expander, pcf8574, pcf8574a, esp32, esp8266, stm32, SAMD, Arduino, wire, rp2040, Raspberry",
"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.",
"homepage": "https://www.mischianti.org/category/my-libraries/pcf8574/",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=PCF8574 library
version=2.3.6
version=2.3.7
author=Renzo Mischianti <[email protected]>
maintainer=Renzo Mischianti <[email protected]>
sentence=Most starred PCF8574 library for Arduino (standard and SAMD), Raspberry Pi Pico and rp2040 boards, ESP8266, smt32 and esp32
Expand Down

0 comments on commit fb05aec

Please sign in to comment.