Skip to content

Commit 77d0496

Browse files
committed
1 parent 418fca7 commit 77d0496

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

PCF8574.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
6060
* @param sda: sda pin
6161
* @param scl: scl pin
6262
*/
63-
PCF8574::PCF8574(uint8_t address, uint8_t sda, uint8_t scl){
63+
PCF8574::PCF8574(uint8_t address, int sda, int scl){
6464
_wire = &Wire;
6565

6666
_address = address;
@@ -76,7 +76,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
7676
* @param interruptPin: pin to set interrupt
7777
* @param interruptFunction: function to call when interrupt raised
7878
*/
79-
PCF8574::PCF8574(uint8_t address, uint8_t sda, uint8_t scl, uint8_t interruptPin, void (*interruptFunction)() ){
79+
PCF8574::PCF8574(uint8_t address, int sda, int scl, uint8_t interruptPin, void (*interruptFunction)() ){
8080
_wire = &Wire;
8181

8282
_address = address;
@@ -122,7 +122,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
122122
* @param sda: sda pin
123123
* @param scl: scl pin
124124
*/
125-
PCF8574::PCF8574(TwoWire *pWire, uint8_t address, uint8_t sda, uint8_t scl){
125+
PCF8574::PCF8574(TwoWire *pWire, uint8_t address, int sda, int scl){
126126
_wire = pWire;
127127

128128
_address = address;
@@ -138,7 +138,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
138138
* @param interruptPin: pin to set interrupt
139139
* @param interruptFunction: function to call when interrupt raised
140140
*/
141-
PCF8574::PCF8574(TwoWire *pWire, uint8_t address, uint8_t sda, uint8_t scl, uint8_t interruptPin, void (*interruptFunction)() ){
141+
PCF8574::PCF8574(TwoWire *pWire, uint8_t address, int sda, int scl, uint8_t interruptPin, void (*interruptFunction)() ){
142142
_wire = pWire;
143143

144144
_address = address;

PCF8574.h

Lines changed: 7 additions & 7 deletions
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.2
5+
* VERSION: 2.3.3
66
*
77
* https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
88
*
@@ -110,17 +110,17 @@ class PCF8574 {
110110
PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunction)() );
111111

112112
#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(__STM32F1__) && !defined(TEENSYDUINO)
113-
PCF8574(uint8_t address, uint8_t sda, uint8_t scl);
114-
PCF8574(uint8_t address, uint8_t sda, uint8_t scl, uint8_t interruptPin, void (*interruptFunction)());
113+
PCF8574(uint8_t address, int sda, int scl);
114+
PCF8574(uint8_t address, int sda, int scl, uint8_t interruptPin, void (*interruptFunction)());
115115
#endif
116116

117117
#ifdef ESP32
118118
///// changes for second i2c bus
119119
PCF8574(TwoWire *pWire, uint8_t address);
120-
PCF8574(TwoWire *pWire, uint8_t address, uint8_t sda, uint8_t scl);
120+
PCF8574(TwoWire *pWire, uint8_t address, int sda, int scl);
121121

122122
PCF8574(TwoWire *pWire, uint8_t address, uint8_t interruptPin, void (*interruptFunction)() );
123-
PCF8574(TwoWire *pWire, uint8_t address, uint8_t sda, uint8_t scl, uint8_t interruptPin, void (*interruptFunction)());
123+
PCF8574(TwoWire *pWire, uint8_t address, int sda, int scl, uint8_t interruptPin, void (*interruptFunction)());
124124
#endif
125125

126126
bool begin();
@@ -223,8 +223,8 @@ class PCF8574 {
223223
# endif
224224
#endif
225225

226-
uint8_t _sda = DEFAULT_SDA;
227-
uint8_t _scl = DEFAULT_SCL;
226+
int _sda = DEFAULT_SDA;
227+
int _scl = DEFAULT_SCL;
228228

229229
TwoWire *_wire;
230230

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.2
5+
* VERSION: 2.3.3
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
@@ -29,6 +29,7 @@ Tutorial:
2929
To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder PCF8574. Check that the PCF8574 folder contains `PCF8574\\.cpp` and `PCF8574.h`. Place the DHT library folder your `<arduinosketchfolder>/libraries/` folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
3030

3131
## Changelog
32+
28/07/2022: v2.3.3 Force SDA SCL to use GPIO numeration (https://www.mischianti.org/forums/topic/cannot-set-sda-clk-on-esp8266/).
3233
28/07/2022: v2.3.2 Fix the SDA SCL type #58 and add basic support for SAMD device.
3334
26/04/2022: v2.3.1 Fix example for esp32 and double begin issue #56.
3435
06/04/2022: v2.3.0 Fix package size

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.2",
3+
"version": "2.3.3",
44
"keywords": "digital, i2c, encoder, expander, pcf8574, pcf8574a, esp32, esp8266, stm32, SAMD, Arduino, wire",
55
"description": "i2c digital expander for Arduino, 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.2
2+
version=2.3.3
33
author=Renzo Mischianti <renzo.mischianti@gmail.com>
44
maintainer=Renzo Mischianti <renzo.mischianti@gmail.com>
55
sentence=PCF8574, library for Arduino, ESP8266, smt32 and esp32

0 commit comments

Comments
 (0)