ESP-IDF project for LilyGO T4 V1.3 with ILI9341 2.4" display. Fast, efficient, and now with extra pizzazz! 💫
- Loading Indicator: Smooth blue gradient animation while frames load
- PSRAM Optimization: Efficient memory usage with PSRAM preloading
- Smooth Playback: Optimized frame display with minimal tearing
- Fast Startup: Quick initialization and display readiness
- Memory Efficient: Smart PSRAM allocation for large sequences
- Startup Time: ~500ms to first frame
- Frame Loading: Background loading with visual indicator
- Playback FPS: Up to 30fps for optimized sequences
- Memory Usage: Efficient PSRAM utilization (8MB available)
- RGB565 raw binary (native format)
- JPEG (via optimized conversion to RGB565)
- Animation Sequences (from manifest file)
- Full screen images (240x320)
- Loading animations
- Smooth frame transitions
- Memory-efficient streaming
- PSRAM-optimized buffering
-
Convert Those JPEGs, Bestie!
- RGB565 raw format is YOUR FRIEND
- JPEGs are so last season (they need decoding, ew!)
- Use the ffmpeg command below and thank me later 💁♀️
-
Size Queen Energy
- 240x320 EXACTLY - no compromises!
- Runtime resizing? I don't know her 🙅♀️
- Keep those dimensions consistent across your sequence
-
Memory is Everything
- PSRAM is your best friend (8MB of fabulousness)
- Group similar frames together like they're besties
- Clean up after yourself, nobody likes a messy heap 💅
-
Timing is Life
- SPI @ 40MHz is serving lewks
- DMA transfers are your runway to success
- Frame delays? Make them werk! 💃
# Convert that basic JPEG to fabulous RGB565
ffmpeg -i your_image.jpeg -vf scale=240:320 -f rawvideo -pix_fmt rgb565le image.rgb565
# Put it where it belongs
cp image.rgb565 data/images/# Convert JPEG to RGB565 raw format
ffmpeg -i your_image.jpeg -vf scale=240:320 -f rawvideo -pix_fmt rgb565le image.rgb565
# Copy to project
cp image.rgb565 data/images/- Copy your JPEGs to
data/output/ - Create a manifest file listing your images
- Images will load with a smooth loading animation!
#define PIN_NUM_MISO 12
#define PIN_NUM_MOSI 23
#define PIN_NUM_CLK 18
#define PIN_NUM_CS 27
#define PIN_NUM_DC 32
#define PIN_NUM_RST 5
#define PIN_NUM_BCKL 4- Resolution: 240x320 pixels
- Color depth: 16-bit (RGB565)
- Interface: SPI @ 40MHz
- Driver: ILI9341
- Memory: 8MB PSRAM available
- Fast Display: Direct SPI DMA transfers
- Smooth Loading: Visual feedback during operations
- Memory Smart: Efficient PSRAM usage
- Clean Exit: Proper resource cleanup
-
Slow Frame Rate
- Check image dimensions
- Verify PSRAM is enabled
- Monitor memory usage
- Consider RGB565 conversion
-
Display Glitches
- Verify SPI connections
- Check power supply
- Validate image format
- Monitor memory allocation
-
Memory Issues
- Use PSRAM for large sequences
- Monitor heap fragmentation
- Clean up unused resources
- Check allocation patterns
// Initialize display and filesystem
esp_err_t init_display(void);
// Load and display RGB565 image
esp_err_t load_and_display_raw_image(const char* filename);
// Play sequence of JPEGs with loading animation
esp_err_t play_jpeg_sequence_from_manifest(const char* manifest_path, uint32_t frame_delay_ms);Found a bug? Want to add a feature? PRs welcome! Just keep it sassy and clean! 💅
Tired of your ESP32 carrying more baggage than necessary? Use our minimal configuration:
# Use the minimal config (saves ~40-50% flash space!)
cp sdkconfig.minimal sdkconfig
idf.py buildYour sdkconfig can get overwritten! Here's how to keep it safe:
# 1. Always keep sdkconfig.minimal as your backup
cp sdkconfig.minimal sdkconfig.backup
# 2. Before any ESP-IDF operations that might change config:
cp sdkconfig.minimal sdkconfig
# 3. After menuconfig or updates, restore if needed:
cp sdkconfig.minimal sdkconfig
# 4. Check if your config got messed with:
diff sdkconfig.minimal sdkconfigWhen sdkconfig gets overwritten:
- ❌ Running
idf.py menuconfigand saving - ❌ ESP-IDF framework updates
- ❌ Running
idf.py reconfigure - ❌ Changing target chips
- ❌ Build system "fixes" conflicting options
Pro tip: Add sdkconfig.minimal to your version control, NOT sdkconfig!
# Check what's actually being compiled
idf.py build | grep "Compiling"What the minimal config removes:
- ❌ WiFi stack (saves ~300KB)
- ❌ Bluetooth (saves ~200KB)
- ❌ Ethernet drivers
- ❌ mbedTLS crypto libraries (saves ~150KB)
- ❌ HTTP/MQTT clients
- ❌ Touch sensor drivers
- ❌ I2S audio drivers
- ❌ USB support
- ❌ Unnecessary ADC calibration
What it keeps:
- ✅ Display drivers (ILI9341)
- ✅ SPIFFS file system
- ✅ JPEG decoder
- ✅ Rotary encoder (PCNT)
- ✅ SPI/GPIO drivers
- ✅ PSRAM support
- ✅ Performance optimizations
Result: Binary size drops from ~640KB to ~300-400KB! 💅
MIT License - Go wild, make something awesome! ✨