I'm trying to compile a simple example project (unoSsd1306Ascii) to begin using this library. The problem is that the OLED seems to be associated with AVR architecture and not for ESP32.
My environment is a virtual machine with Ubuntu 20, PlatformIO on VisualStudio and the hardware is an ESP32. The OLED is connected to the ESP32 via I2C.
Some errors I've found compiling the example...
.pio/libdeps/esp32dev/SSD1306Ascii/src/utility/AvrI2c.h: In member function 'void AvrI2c::begin(bool)':
.pio/libdeps/esp32dev/SSD1306Ascii/src/utility/AvrI2c.h:65:5: error: 'TWSR' was not declared in this scope
.pio/libdeps/esp32dev/SSD1306Ascii/src/utility/AvrI2c.h: In member function 'uint8_t AvrI2c::read(bool)':
.pio/libdeps/esp32dev/SSD1306Ascii/src/utility/AvrI2c.h:77:19: error: 'TWINT' was not declared in this scope
What should I do to handle this OLED (SSD1306) with ESP32?
Thanks for your help.
I don’t think you can to be honest. But you should ask the library provider, as the errors are in their library. We just provide some glue code to make it work with tcMenu. On such a large processor why not u8g2 with an SPI OLED?
For the benefit of others too, I'll expand on this a little.
Apart from the OLED mbed support, where we provide a modified version of the AdafruitGFX library, all other display libraries are written by third parties, and we provide the glue code to allow you to use it in tcMenu without writing a line of code.
Arduino: For OLEDs SSD1306, SH1106 and many other variants
On Uno and other ATMega328 based processors with limited memory - use SSD1306Ascii
On any other processor - use u8g2
For Colour and other monochrome TFTs
ESP32 and STM32 - For most larger color TFTs we are integrating the excellent TFT_eSPI library that provides much faster drawing than other options. Due in 1.8.
Other Arduino devices: Use AdafruitGFX in nearly all cases, almost invariably these displays will not be usable with an Uno / ATMega328. You're better with 32-bit boards for larger color displays, where the SPI speed can be boosted.
For 16x2, 20x4 and other LCD units
Use the inbuilt LiquidCrystal plugin.
Mbed
Mbed: For OLEDs SSD1306 and SH1106
Use the inbuilt AdafruitGFX fork in the designer.
For Colour and other monochrome TFTs
Due in 1.8 - for STM32 boards will be able to support the inbuilt frame buffer.