diff --git a/PCF8574.cpp b/PCF8574.cpp index 9b40181..a16ffec 100644 --- a/PCF8574.cpp +++ b/PCF8574.cpp @@ -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 */ diff --git a/PCF8574.h b/PCF8574.h index a53ca7a..b05d6d1 100644 --- a/PCF8574.h +++ b/PCF8574.h @@ -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/ * @@ -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); diff --git a/PCF8574_library.h b/PCF8574_library.h index 4fa0989..8f1e4fe 100644 --- a/PCF8574_library.h +++ b/PCF8574_library.h @@ -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/ * diff --git a/README.md b/README.md index 50e9b9f..0f5471c 100644 --- a/README.md +++ b/README.md @@ -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/). diff --git a/library.json b/library.json index 4aac31b..a80d9ab 100644 --- a/library.json +++ b/library.json @@ -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/", diff --git a/library.properties b/library.properties index 243c1c9..4fbd93d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=PCF8574 library -version=2.3.6 +version=2.3.7 author=Renzo Mischianti maintainer=Renzo Mischianti sentence=Most starred PCF8574 library for Arduino (standard and SAMD), Raspberry Pi Pico and rp2040 boards, ESP8266, smt32 and esp32