diff --git a/libraries/I2C_SCANNER/CHANGELOG.md b/libraries/I2C_SCANNER/CHANGELOG.md index 514dade9..b01fbee6 100644 --- a/libraries/I2C_SCANNER/CHANGELOG.md +++ b/libraries/I2C_SCANNER/CHANGELOG.md @@ -6,11 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.0] - 2023-12-05 +- remove **begin(sda, scl)** to have less board specific dependencies. + + +---- + ## [0.2.1] - 2023-09-24 - fix Wire1 support ESP32 - update keywords.txt - ## [0.2.0] - 2023-08-21 - changed interface for **uint16_t ping(address, uint16_t count = 1)** - allows multiple tries, for extended diagnosis. diff --git a/libraries/I2C_SCANNER/I2C_SCANNER.cpp b/libraries/I2C_SCANNER/I2C_SCANNER.cpp index 25dd639c..74525970 100644 --- a/libraries/I2C_SCANNER/I2C_SCANNER.cpp +++ b/libraries/I2C_SCANNER/I2C_SCANNER.cpp @@ -1,7 +1,7 @@ // // FILE: I2C_SCANNER.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.2.1 +// VERSION: 0.3.0 // DATE: 2022-08-29 // PURPOSE: Arduino class to implement an I2C scanner. @@ -21,26 +21,10 @@ I2C_SCANNER::I2C_SCANNER(TwoWire *wire) bool I2C_SCANNER::begin() { _init(); - _wire->begin(); return true; } -#if defined (ESP8266) || defined(ESP32) -bool I2C_SCANNER::begin(int dataPin, int clockPin) -{ - _init(); - if ((dataPin < 255) && (clockPin < 255)) - { - _wire->begin(dataPin, clockPin); - } else { - _wire->begin(); - } - return true; -} -#endif - - // // I2C PORT // diff --git a/libraries/I2C_SCANNER/I2C_SCANNER.h b/libraries/I2C_SCANNER/I2C_SCANNER.h index a4c9178f..fcc5e178 100644 --- a/libraries/I2C_SCANNER/I2C_SCANNER.h +++ b/libraries/I2C_SCANNER/I2C_SCANNER.h @@ -2,7 +2,7 @@ // // FILE: I2C_SCANNER.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.1 +// VERSION: 0.3.0 // DATE: 2022-08-29 // PURPOSE: Arduino class to implement an I2C scanner. @@ -10,7 +10,7 @@ #include "Arduino.h" #include "Wire.h" -#define I2C_SCANNER_LIB_VERSION (F("0.2.1")) +#define I2C_SCANNER_LIB_VERSION (F("0.3.0")) class I2C_SCANNER @@ -21,9 +21,6 @@ public: // CONFIGURATION bool begin(); -#if defined (ESP8266) || defined(ESP32) - bool begin(int sda, int scl); -#endif // I2C PORT uint8_t getWirePortCount(); diff --git a/libraries/I2C_SCANNER/README.md b/libraries/I2C_SCANNER/README.md index 77823002..96d4904f 100644 --- a/libraries/I2C_SCANNER/README.md +++ b/libraries/I2C_SCANNER/README.md @@ -33,6 +33,15 @@ The user may use other values for address at his own risk. If there is missing functionality in this library, please file an issue. +#### 0.3.0 Breaking change + +Version 0.3.0 introduced a breaking change. +You cannot set the pins in **begin()** any more. +This reduces the dependency of processor dependent Wire implementations. +The user has to call **Wire.begin()** and can optionally set the Wire pins +before calling **begin()**. + + #### Testing The library is tested with the following boards: @@ -63,7 +72,6 @@ Please file an issue if your board does work (or not). - **I2C_SCANNER(TwoWire \*wire = &Wire)** Constructor with the default Wire I2C bus. - **bool begin()** To start the Wire library. -- **bool begin(int sda, int scl)** idem for ESP32 et al. #### Configuration diff --git a/libraries/I2C_SCANNER/examples/I2C_scanner_count/I2C_scanner_count.ino b/libraries/I2C_SCANNER/examples/I2C_scanner_count/I2C_scanner_count.ino index 81e6c475..7a4a4aec 100644 --- a/libraries/I2C_SCANNER/examples/I2C_scanner_count/I2C_scanner_count.ino +++ b/libraries/I2C_SCANNER/examples/I2C_scanner_count/I2C_scanner_count.ino @@ -18,6 +18,7 @@ void setup() Serial.print("I2C_SCANNER_LIB_VERSION: "); Serial.println(I2C_SCANNER_LIB_VERSION); + Wire.begin(); scanner.begin(); int ports = scanner.getWirePortCount(); diff --git a/libraries/I2C_SCANNER/examples/I2C_scanner_getWirePortCount/I2C_scanner_getWirePortCount.ino b/libraries/I2C_SCANNER/examples/I2C_scanner_getWirePortCount/I2C_scanner_getWirePortCount.ino index 5b21df90..24a264b7 100644 --- a/libraries/I2C_SCANNER/examples/I2C_scanner_getWirePortCount/I2C_scanner_getWirePortCount.ino +++ b/libraries/I2C_SCANNER/examples/I2C_scanner_getWirePortCount/I2C_scanner_getWirePortCount.ino @@ -18,6 +18,7 @@ void setup() Serial.print("I2C_SCANNER_LIB_VERSION: "); Serial.println(I2C_SCANNER_LIB_VERSION); + Wire.begin(); scanner.begin(); Serial.print("I2C ports: \t"); diff --git a/libraries/I2C_SCANNER/examples/I2C_scanner_minimal/I2C_scanner_minimal.ino b/libraries/I2C_SCANNER/examples/I2C_scanner_minimal/I2C_scanner_minimal.ino index 1583073f..4379b059 100644 --- a/libraries/I2C_SCANNER/examples/I2C_scanner_minimal/I2C_scanner_minimal.ino +++ b/libraries/I2C_SCANNER/examples/I2C_scanner_minimal/I2C_scanner_minimal.ino @@ -18,6 +18,7 @@ void setup() Serial.print("I2C_SCANNER_LIB_VERSION: "); Serial.println(I2C_SCANNER_LIB_VERSION); + Wire.begin(); scanner.begin(); for (int addr = 0; addr < 128; addr++) diff --git a/libraries/I2C_SCANNER/examples/I2C_scanner_ping_count/I2C_scanner_ping_count.ino b/libraries/I2C_SCANNER/examples/I2C_scanner_ping_count/I2C_scanner_ping_count.ino index b41c8632..03597bd0 100644 --- a/libraries/I2C_SCANNER/examples/I2C_scanner_ping_count/I2C_scanner_ping_count.ino +++ b/libraries/I2C_SCANNER/examples/I2C_scanner_ping_count/I2C_scanner_ping_count.ino @@ -18,6 +18,7 @@ void setup() Serial.print("I2C_SCANNER_LIB_VERSION: "); Serial.println(I2C_SCANNER_LIB_VERSION); + Wire.begin(); scanner.begin(); for (int addr = 0; addr < 128; addr++) diff --git a/libraries/I2C_SCANNER/examples/I2C_scanner_simple/I2C_scanner_simple.ino b/libraries/I2C_SCANNER/examples/I2C_scanner_simple/I2C_scanner_simple.ino index c467f117..6d471760 100644 --- a/libraries/I2C_SCANNER/examples/I2C_scanner_simple/I2C_scanner_simple.ino +++ b/libraries/I2C_SCANNER/examples/I2C_scanner_simple/I2C_scanner_simple.ino @@ -18,6 +18,7 @@ void setup() Serial.print("I2C_SCANNER_LIB_VERSION: "); Serial.println(I2C_SCANNER_LIB_VERSION); + Wire.begin(); scanner.begin(); for (int addr = 0; addr < 128; addr++) diff --git a/libraries/I2C_SCANNER/library.json b/libraries/I2C_SCANNER/library.json index 2a68bdd5..080918e8 100644 --- a/libraries/I2C_SCANNER/library.json +++ b/libraries/I2C_SCANNER/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/I2C_SCANNER.git" }, - "version": "0.2.1", + "version": "0.3.0", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/I2C_SCANNER/library.properties b/libraries/I2C_SCANNER/library.properties index be7a4b70..35fdd579 100644 --- a/libraries/I2C_SCANNER/library.properties +++ b/libraries/I2C_SCANNER/library.properties @@ -1,5 +1,5 @@ name=I2C_SCANNER -version=0.2.1 +version=0.3.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino class to implement an I2C scanner.