Skip to content

Commit f3b1b32

Browse files
authored
Change SDA/SCL from uint8_t to int (#348)
This allows to assign `-1` to skip the call to `begin()`.
1 parent 00dc3ff commit f3b1b32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SH1106Wire.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
class SH1106Wire : public OLEDDisplay {
4444
private:
4545
uint8_t _address;
46-
uint8_t _sda;
47-
uint8_t _scl;
46+
int _sda;
47+
int _scl;
4848
bool _doI2cAutoInit = false;
4949
TwoWire* _wire = NULL;
5050
int _frequency;
@@ -65,7 +65,7 @@ class SH1106Wire : public OLEDDisplay {
6565
* @param _i2cBus on ESP32 with 2 I2C HW buses, I2C_ONE for 1st Bus, I2C_TWO fot 2nd bus, default I2C_ONE
6666
* @param _frequency for Frequency by default Let's use ~700khz if ESP8266 is in 160Mhz mode, this will be limited to ~400khz if the ESP8266 in 80Mhz mode
6767
*/
68-
SH1106Wire(uint8_t _address, uint8_t _sda, uint8_t _scl, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64, HW_I2C _i2cBus = I2C_ONE, int _frequency = 700000) {
68+
SH1106Wire(uint8_t _address, int _sda = -1, int _scl = -1, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64, HW_I2C _i2cBus = I2C_ONE, int _frequency = 700000) {
6969
setGeometry(g);
7070

7171
this->_address = _address;

0 commit comments

Comments
 (0)