Does anyone have any tutorials or advice in using a Esp32 with the U8G2 library and a SD1306 display. Seems a lot of the tutorials or sample code are years old. Would have thought there would have been a simpler approach.
Have a project currently using the U8g2 library and display on a Uno but running out of memory, wanted to port the whole project over to a ESP32, but stumped on how to get the display working.
Which board did you use, not sure how a ESP32 board would work without the modifications required in the link I posted. Issue is it refers to creating directories and modifications, but I don't see how one does that in the Arduino IDE environment.
I actually used a Wemos/TTGO D1 R32 which is a Uno format board.
The IDE was set for "ESP32 Dev Module"
The IDE was v1.8.12
I ran example fresh from U8g2lib.
No, I have not studied your GitHub link but I did notice that it is over 2 years old.
ESP32 Core may have been using an old version.
U8g2lib may have been using an old version.
Please report which IDE, Core and library version.
It is not essential to run the "very latest" versions but it is wise to keep reasonably up to date.
Mind you, I am pretty certain that U8g2lib has been working 100% on ESP32, ESP8266, ... for several years.
I suspect that you can look up GitHub history for ESP32 Core, U8g2lib, ... to see what historic problems have arisen and if and when they were fixed.
Oops, I suppose the reason there is not much out there with U8G2 and ESP32 lately is because it works. Just saw this in the reference manual. Just assumed it didn't work. Will get breadboarding it and see what happens.
U8g2 is much more portable than U8glib. It is expected, that U8g2 will work with almost all current and upcoming boards. The following table is my personal experience with boards tested by this project. Many other boards may also work.
Basically all boards with a (more or less) up to date Arduino API will be supported by U8g2. I have feedback that the following systems work with U8g2:
Aruino Zero, Uno, Mega, Due, 101, MKR Zero and probably all other official Arduino boards.
Feather M0, ESP32 and 32u4
STM32 based boards supported by the Arduino IDE
ESP8266 and ESP32 boards supported by the Arduino IDE
Probably all other boards, which are supported by the Arduino IDE
Oliver's supported target board list was posted almost 3 years ago (Feb 2018)
I would be very confident that all his examples will work out of the box.
Mind you, sh*t happens. If you have a problem:
Please quote which example(s) do not work e.g. example name + constructor statement.
together with IDE version, ESP Core version, u8g2lib version number.
Readers here can replicate. If a valid problem, readers can raise an Issue or offer a PullRequest on Oliver's U8g2lib GitHub.
That is how Public Forums operate and Open Source Software is maintained.
I created for a WROOM ESP32 wired to a SSD1306 12864 i2c OLED breakout (four pins) a sketch using U8G2 that is an animation of 6 frames 9662 pixels of a dinosaur (Velociraptor) performing a welcoming gesture. Code starts as follows (board DOITESP32 DEVKITV1)
I did see these two constructors in the default list with a comment that they are for ESP32. But I wonder why pins 16/17 (TX2). Your constructor the pins used are GPIO 21 and 22 which appears to the correct pinouts that I see when doing a google search of the ESP32, maybe different variants of boards??
I am having trouble with the basic use of the IDE. When I use Sketch-Include Library for U8g2 I get #include <U8g2lib.h> #include <U8x8lib.h>
but not #include <U8g2.h>
which my sketch calls.
If I type in #include <U8g2.h>
I get an error saying that file can not be found.
What am I doing wrong?
I assume that you installed the u8g2 library either by a download and imported as a library or using the Tools-->Library Manager> searching for U8G2 and downloading the library by this means.