Conflicts:
	PCF8574.cpp
	README.md
This commit is contained in:
Renzo Mischianti 2019-04-29 09:22:17 +02:00
commit 6d377772fa
3 changed files with 16 additions and 6 deletions

View File

@ -53,7 +53,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
_usingInterrupt = true;
};
#ifndef __AVR
#if !defined(__AVR) && !defined(__STM32F1__)
/**
* Constructor
* @param address: i2c address
@ -156,7 +156,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio
* wake up i2c controller
*/
void PCF8574::begin(){
#ifndef __AVR
#if !defined(__AVR) && !defined(__STM32F1__)
_wire->begin(_sda, _scl);
#else
// Default pin for AVR some problem on software emulation
@ -165,7 +165,7 @@ void PCF8574::begin(){
_wire->begin();
#endif
// Che if there are pins to set low
// Check if there are pins to set low
if (writeMode>0 || readMode>0){
DEBUG_PRINTLN("Set write mode");
_wire->beginTransmission(_address);

View File

@ -83,7 +83,7 @@ public:
PCF8574(uint8_t address);
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, uint8_t interruptPin, void (*interruptFunction)());
#endif
@ -123,8 +123,14 @@ public:
private:
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;

View File

@ -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/).
=======
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).