Simple Demo for an ESP32 module with a TFT LCD or an OLED display.
Displays current time and BTC price in EUR.
Supports two different modules directly:
- ESP32 with I2C connected SSD1306 driven OLED display (resolution 128x64) made by Lolin as WEMOS LOLIN32
- ESP32 with SPI connected ST7789V driven TFT LCD display (resolution 240x135) made by TTGO as T-Display
It's very easy to modify the source code for any I2C or SPI connected display.
This sketch was updated to work with the current ESP32 toolchain used by Arduino IDE 2.3.8.
Main changes:
- replaced Tasker-based scheduling with a plain
millis()loop - switched to
HTTPClient+WiFiClientSecurefor HTTPS requests - added robust API fallback list (no API key required)
The sketch now tries these public/free APIs in sequence until one succeeds:
- CoinGecko:
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=eur - Kraken:
https://api.kraken.com/0/public/Ticker?pair=XBTEUR - Bitstamp:
https://www.bitstamp.net/api/v2/ticker/btceur/
The currently used API source is shown on the display.
Time is synced via NTP using CET (UTC+1) for Europe/Berlin.
Install ESP32 core and these libraries through Arduino Library Manager:
- Adafruit SSD1306 (only if
HAS_OLEDistrue) - Adafruit GFX (only if
HAS_OLEDistrue) - TFT_eSPI (only if
HAS_OLEDisfalse)
To install ESP32 core on Arduino follow the instructions on this page: https://github.com/espressif/arduino-esp32#installation-instructions
Please note that the TTGO T-Display requires version 1.4.16 (or higher) of the TFT_eSPI library, otherwise the screen content is shifted by 52 pixels.
Enjoy!
Petr Stehlik https://github.com/joysfera


