Skip to content

leblitzdick/esp32-btc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-BTC

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.

Arduino IDE 2.3.8 compatibility

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 + WiFiClientSecure for HTTPS requests
  • added robust API fallback list (no API key required)

Free BTC APIs integrated

The sketch now tries these public/free APIs in sequence until one succeeds:

  1. CoinGecko: https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=eur
  2. Kraken: https://api.kraken.com/0/public/Ticker?pair=XBTEUR
  3. 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.

Required libraries

Install ESP32 core and these libraries through Arduino Library Manager:

  • Adafruit SSD1306 (only if HAS_OLED is true)
  • Adafruit GFX (only if HAS_OLED is true)
  • TFT_eSPI (only if HAS_OLED is false)

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

LOLIN32 photo

LOLIN photo

LOLIN32 pinout

LOLIN pinout

TTGO T-Display

TTGO T-display photo+pinout

About

Demo for ESP32 with a display that shows current time and BTC price

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 100.0%