[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

How can I use SSD1306 on ESP32 (not AVR microcontrollers)? RSS feed
Forum Index » tcMenu Arduinio library
Author Message
chirrindulari


Joined: Jan 23, 2021
Messages: 22
Offline
Hi members.

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.
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
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?
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
What should I do to handle this OLED (SSD1306) with ESP32?


That is easier, use the u8g2 plugin.
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
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.

Along with the list below, you can look at the display plugins section here where there's a more complete list with associated documentation: https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/

Arduino

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.

For 16x2, 20x4 and other LCD units

Use the inbuilt LiquidCrystal plugin.
chirrindulari


Joined: Jan 23, 2021
Messages: 22
Offline
Thanks a lot for the explanation, Dave.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.