Hi,
I have a problem with my OLED SSD1306 display.
Usually I use the u8g2 library but it doesn't work with my current ESP32-PICO-D4 , only the Adafruit library works.
So in TcMenu Designer I have correctly declared my screen:
- AdaFruit_GFX with manual declaration and configuration
- Display variable name: gfx
- Display variable type: Adafruit_SSD1306
Then in my sketch I declared :
#include "myMenu_menu.h"
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3D ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 gfx(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
Serial.begin(9600);
Wire.begin(15, 33);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!gfx.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Show initial display buffer contents on the screen --
// the library initializes this with an Adafruit splash screen.
gfx.display();
delay(2000); // Pause for 2 seconds
// Clear the buffer
gfx.clearDisplay();
setupMenu();
}
void loop() {
taskManager.runLoop();
}
My display works, I see the Adafruit logo but my menu does not appear and then my display is black.
I not find a tcMenu example with the Adafruit library.
My project is attached, if you can help me or if you have an example that would be nice.
Thanks