Okay. Heute habe ich einen Test-Sketch in der Arduino IDE gemacht. Auf ein ESP32 habe ich mit folgendem Code den Display zum Leben erweckt:
Okay. Today I made a test sketch in the Arduino IDE. I brought the display to life on an ESP32 with the following code:
#include <U8g2lib.h>
#include <Wire.h>
#define SDA_0 22
#define SCL_0 21
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL_0, /* data=*/ SDA_0);
void setup()
{
u8g2.begin();
}
void loop() {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}
Der Aufbau ist sehr puritan, aber ein positives Ergebnis ist da:
The build up is very puritan, but there is a positive result:

Der einzige Unterschied zum Code in Teensymower, dass hier die SCL and SDA Pins der ESP32 in der Constructor definiert sind. Wenn ich diese Pin Definition weglasse, funktioniert die Oled nicht.
Also ich habe in der teensymower Code (screen.cpp) für die I2C_2 Port die Pins 24 und 25 versucht zu definieren.
Es wird compiliert aber gleiches Ergebnis. Es lässt die Oled leider auch so nicht aktivieren.
Hm. Entweder stimmt etwas mit meiner Library nicht, oder mit der I2C_2 Pin-Definition.
The only difference to the code in Teensymower is that the SCL and SDA pins of the ESP32 are defined in the constructor. Without this pin definition, the OLED doesn't work.
So I tried to define pins 24 and 25 in the teensymower code (screen.cpp) for the I2C_2 port.
It compiles without error, but the result is the same. Unfortunately, it doesn't activate the OLED.
Hm. Either there's something wrong with my library or with the I2C_2 pin definition.
Giving up is not an option... the show (mower) must go on!
