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

help working exmaples with heltec v2 #366

Open qubolino opened 2 years ago

qubolino commented 2 years ago

i have a heltex esp32 board with screen wired like this

#define PIN_I2C_SCL GPIO_NUM_15   // SCL pin
#define PIN_I2C_SDA GPIO_NUM_4    // SDA pin
#define OLED_I2C_ADDR 0x3C        // I2C address of the OLED display
#define PIN_OLED_RST GPIO_NUM_16  // OLED RESET: low-active

i'm trying to make the simple demo example work with it but no success so far... any ideas?

andreaslanz commented 2 years ago

Hi, for heltec_wifi_lora_32_V2

i have success with :

in main.cpp:

SSD1306Wire display(0x3c, 4, 15,GEOMETRY_128_64); // ADDRESS, SDA, SCL - SDA and SCL usually populate automatically based on your board's pins_arduino.h e.g. https://github.com/esp8266/Arduino/blob/master/variants/nodemcu/pins_arduino.h

in the file SSD1306Wire.h: i add somme code at the begin of the connect() function: (for reset the OLED Modul)

    bool connect() {
        pinMode(16,OUTPUT);
        digitalWrite(16, LOW);
        delay(50);
        digitalWrite(16, HIGH);