ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2.01k stars 638 forks source link

I2C_ONE / I2C_TWO are not declared but the HW_I2C enum is? #373

Open H3wastooshort opened 2 years ago

H3wastooshort commented 2 years ago

Describe the bug Trying to define the I2C clockspeed i have to put in I2C_ONE / I2C_TWO but those are not defined even when includeing OLEDDisplay.h

#include <OLEDDisplay.h>
#include <SSD1306Wire.h>

SSD1306Wire oled(0x3c, 0, 2, GEOMETRY_128_64, I2C_ONE, 200000);

void setup() {}
void loop() {}

results in

exit status 1
'I2C_ONE' was not declared in this scope

====

#include <OLEDDisplay.h>
#include <SSD1306Wire.h>

enum HW_I2C {
  I2C_ONE,
  I2C_TWO
};
SSD1306Wire oled(0x3c, 0, 2, GEOMETRY_128_64, I2C_ONE, 200000);

void setup() {}
void loop() {}

results in

exit status 1
multiple definition of 'enum HW_I2C'

====

#include <OLEDDisplay.h>
#include <SSD1306Wire.h>

SSD1306Wire oled(0x3c, 0, 2, GEOMETRY_128_64, (HW_I2C)1, 200000);

void setup() {}
void loop() {}

results in

exit status 1
'HW_I2C' was not declared in this scope

im kinda confused. its defined and not defined at the same time.

Versions (please complete the following information):