mirror of
https://github.com/xreef/PCF8574_library.git
synced 2024-08-30 18:12:18 +00:00
Merge branch 'master' of https://github.com/xreef/PCF8574_library.git
Conflicts: PCF8574.cpp README.md
This commit is contained in:
commit
6d377772fa
@ -53,7 +53,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
|
|||||||
_usingInterrupt = true;
|
_usingInterrupt = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef __AVR
|
#if !defined(__AVR) && !defined(__STM32F1__)
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param address: i2c address
|
* @param address: i2c address
|
||||||
@ -156,7 +156,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
|
|||||||
* wake up i2c controller
|
* wake up i2c controller
|
||||||
*/
|
*/
|
||||||
void PCF8574::begin(){
|
void PCF8574::begin(){
|
||||||
#ifndef __AVR
|
#if !defined(__AVR) && !defined(__STM32F1__)
|
||||||
_wire->begin(_sda, _scl);
|
_wire->begin(_sda, _scl);
|
||||||
#else
|
#else
|
||||||
// Default pin for AVR some problem on software emulation
|
// Default pin for AVR some problem on software emulation
|
||||||
@ -165,7 +165,7 @@ void PCF8574::begin(){
|
|||||||
_wire->begin();
|
_wire->begin();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Che if there are pins to set low
|
// Check if there are pins to set low
|
||||||
if (writeMode>0 || readMode>0){
|
if (writeMode>0 || readMode>0){
|
||||||
DEBUG_PRINTLN("Set write mode");
|
DEBUG_PRINTLN("Set write mode");
|
||||||
_wire->beginTransmission(_address);
|
_wire->beginTransmission(_address);
|
||||||
|
12
PCF8574.h
12
PCF8574.h
@ -83,7 +83,7 @@ public:
|
|||||||
PCF8574(uint8_t address);
|
PCF8574(uint8_t address);
|
||||||
PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunction)() );
|
PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunction)() );
|
||||||
|
|
||||||
#ifndef __AVR
|
#if !defined(__AVR) && !defined(__STM32F1__)
|
||||||
PCF8574(uint8_t address, uint8_t sda, uint8_t scl);
|
PCF8574(uint8_t address, uint8_t sda, uint8_t scl);
|
||||||
PCF8574(uint8_t address, uint8_t sda, uint8_t scl, uint8_t interruptPin, void (*interruptFunction)());
|
PCF8574(uint8_t address, uint8_t sda, uint8_t scl, uint8_t interruptPin, void (*interruptFunction)());
|
||||||
#endif
|
#endif
|
||||||
@ -123,8 +123,14 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t _address;
|
uint8_t _address;
|
||||||
uint8_t _sda = SDA;
|
|
||||||
uint8_t _scl = SCL;
|
#if defined(__AVR) || defined(__STM32F1__)
|
||||||
|
uint8_t _sda;
|
||||||
|
uint8_t _scl;
|
||||||
|
#else
|
||||||
|
uint8_t _sda = SDA;
|
||||||
|
uint8_t _scl = SCL;
|
||||||
|
#endif
|
||||||
|
|
||||||
TwoWire *_wire;
|
TwoWire *_wire;
|
||||||
|
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
Additional information and document update here on my site: [pcf8574 Article](https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/).
|
Additional information and document update here on my site: [pcf8574 Article](https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/).
|
||||||
|
=======
|
||||||
|
You can find document update at www.mischianti.org
|
||||||
|
>>>>>>> branch 'master' of https://github.com/xreef/PCF8574_library.git
|
||||||
|
|
||||||
Library to use i2c analog IC with arduino and esp8266. Can read and write digital value with only 2 wire (perfect for ESP-01).
|
Library to use i2c analog IC with arduino and esp8266. Can read and write digital value with only 2 wire (perfect for ESP-01).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user