A feature-rich ESP32 project for the LilyGo T-Display AMOLED board, featuring interactive widgets for stock tracking and Clockify time management using LVGL.
- Stock price tracking using Financial Modeling Prep API
- 30-day price history chart with visual trends
- Percentage and dollar change indicators
- Color-coded price movements (green for gains, red for losses)
- Currently configured for Tesla (TSLA) stock
- Integration with Clockify time tracking API
- Start/stop timers directly from the device
- View your time entry history
- Live timer display for in-progress tasks
- Quick-start timers from previous entries
- Automatic data synchronization
- Board: LilyGo T-Display S3 AMOLED (1.91 inch, with touch)
- PlatformIO installed
- Clockify API Free key (get from Clockify)
- Financial Modeling Prep API Free key (get from FMP)
- WiFi credentials
git clone https://github.com/KerteszRoland/ESP32-lvgl-widgets
cd ESP32-lvgl-widgetsCreate a private_config.ini file in the root directory based on the example:
cp "private_config example.ini" private_config.iniEdit private_config.ini and add your credentials:
PlatformIO will automatically install the required dependencies listed in platformio.ini:
- LVGL v9.3
- TFT_eSPI
- ArduinoJson
- XPowersLib
- And more...
# Build the project
pio run
# Upload to the board
pio run --target upload
# Monitor serial output
pio device monitorOr use PlatformIO IDE's built-in buttons.
The interface uses a tileview with swipe navigation:
- Home Screen (Tile 0): Stock widget - swipe left to access Clockify
- Clockify Screen (Tile 1): Time tracking widget - swipe right to return
The stock widget automatically:
- Fetches the latest price data on startup
- Displays current price with trend indicators
- Shows 30-day price history chart
- Show price movements (percentage and dollar change)
To track a different stock, modify the STOCK_TICKER constant in files/stock_widget.cpp:
const std::string STOCK_TICKER = "TSLA"; // Change to your preferred ticker- View Active Timer: If a timer is running, it displays at the top with a stop button
- Timer History: Scroll through your recent time entries
- Start Timer: Tap the play button on any previous entry to start a new timer based on that entry
- Stop Timer: Tap the stop button to end the current timer
ESP32-lvgl-widgets/
βββ boards/
β βββ T-Display-AMOLED.json # Board definition
βββ files/ # Main source directory
β βββ main.ino # Main application entry point
β βββ config.h # Configuration validation
β βββ stock_widget.cpp/.h # Stock widget implementation
β βββ clockify_widget.cpp/.h # Clockify widget implementation
β βββ src/
β βββ arial_20.c # Custom font
β βββ arial_26.c # Custom font
βββ src/ # Library source files
β βββ LilyGo_AMOLED.cpp/.h # Board-specific driver
β βββ LV_Helper.cpp/.h # LVGL helper functions
β βββ lv_conf.h # LVGL configuration
β βββ ...
βββ platformio.ini # PlatformIO configuration
βββ private_config.ini # Your private credentials (gitignored)
βββ private_config example.ini # Template for credentials
- Create widget header and implementation files in
files/ - Include the widget in
main.ino - Add a new tile to the tileview:
lv_obj_t * tile_new = lv_tileview_add_tile(tileview, x, y, direction);
render_your_widget(tile_new);Edit STOCK_TICKER in files/stock_widget.cpp:
const std::string STOCK_TICKER = "AAPL"; // Apple
// or
const std::string STOCK_TICKER = "GOOGL"; // GoogleIn files/clockify_widget.cpp:
const int REFRESH_CLOCKIFY_WIDGET_TIMER_FREQ_MS = 500; // Timer update frequency
const int REFRESH_CLOCKIFY_WIDGET_POLLING_FREQ_MS = 5000; // API polling frequencyEnable debug output by setting in files/stock_widget.cpp and files/clockify_widget.cpp:
const bool DEBUG_API_REQUESTS = true;Monitor serial output at 115200 baud.
| Library | Version | Purpose |
|---|---|---|
| mikalhart/TinyGPSPlus | 1.0.3 | GPS data parsing |
| adafruit/Adafruit NeoPixel | 1.11.0 | LED control |
| bxparks/AceButton | 1.10.1 | Button handling |
| lvgl/lvgl | 9.3 | Graphics library |
| lewisxhe/XPowersLib | 0.2.7 | Power management |
| lewisxhe/SensorLib | 0.2.4 | Sensor interfacing |
| bodmer/TFT_eSPI | 2.5.31 | Display driver |
| FS | - | File system |
| SPIFFS | - | Flash file system |
| SD | - | SD card support |
| sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library | ^1.1.2 | Heart rate sensor |
| paulstoffregen/OneWire | ^2.3.8 | OneWire protocol |
| bblanchon/ArduinoJson | ^7.4.2 | JSON parsing |
- LilyGo for the T-Display AMOLED hardware and git repo
- LVGL team for the graphics library
- Financial Modeling Prep for stock data API
- Clockify for time tracking API