User reported the live preview "looks slow" after the JPEG decode fix. Diagnosis: each tft.drawRGBBitmap pushes width × height × 2 bytes over SPI, and every byte takes a full QEMU → worker → backend (WS) → frontend round-trip. At 160×120 that's 38 400 messages per frame; the bus saturates at ~0.2 fps perceived. Two changes shrink the per-frame SPI bandwidth: 1. Preview 160×120 → 80×60 (and JPG_SCALE_2X → JPG_SCALE_4X). 38 400 bytes/frame → 9 600 bytes/frame. Already 4× faster. 2. Status bar redraw throttled to every 10th frame instead of every frame. The text writes (printf, fillRect, fillCircle) account for another ~1-2 KB of SPI traffic per loop iteration. Skipping 9 of every 10 redraws frees up a chunk more bandwidth without losing the headline numbers (fps, frame counter) — they just refresh once a second instead of 5x/sec. Also dropped the trailing `delay(20)` — we don't need an artificial throttle, the SPI bus is the throttle. Real-hardware effect: zero. ESP32 SPI runs at 80 MHz; a full 160×120 bitmap pushes in ~4 ms either way. Applied in two places: - examples/esp32-cam-lcd-preview/esp32-cam-lcd-preview.ino - frontend/src/data/examples.ts (in-app gallery copy) Long-term plan: batch SPI bytes at the worker level (one WS message per N bytes instead of per byte) — that's a deeper change in qemu-lcgamboa + Esp32Bridge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| esp32-cam-lcd-preview | ||
| README.md | ||
README.md
Velxio examples
Ready-to-run sketches that exercise specific Velxio features end-to-end. Each subdirectory ships:
*.ino— the sketch (paste into Velxio's editor)diagram.json— wiring layout (parts + connections, Wokwi-compatible format)libraries.txt— Arduino libraries to install via Library ManagerREADME.md— wiring picture, run instructions, what to expect
Index
| Folder | Board | Demonstrates |
|---|---|---|
esp32-cam-lcd-preview/ |
ESP32-CAM + ILI9341 | Live webcam preview decoded with jpg2rgb565 and rendered to a 320×240 SPI TFT |
Adding a new example
- Create a folder named after the demo (e.g.
arduino-uno-pong-rgb/). - Drop in the four files above.
- Wire
diagram.jsonusing the velxio/wokwi part types — see existing examples for naming. Velxio-specific boards use thevelxio-prefix (velxio-esp32-cam); generic Wokwi parts usewokwi-(wokwi-ili9341,wokwi-led, etc.). - Add a row to the table above.
If your example needs more than the standard libraries, list every
required library in libraries.txt (one per line, # for comments).