Micro OLED Eyes
2026 | DFAB | C++
A small hardware exploration using a Seeed Studio XIAO RP2040 and two SH1106 OLED displays to drive synchronized eye-tracking animations.
Animation & Micro-Interactions
- Easing Functions: Applying smooth easing curves to eyelid motion drastically improved the natural cadence of blinks.
- Micro-Saccades & Idle Drift: Adding a gentle, slow vertical drift to the baseline eye positioning avoids a frozen state and gives a subtle sense of breathing.
- Slight Convergence (Cross-Eyed Offset): Angling the focal axes slightly inward creates a realistic depth of field and immediate personality.
Code: GitHub Repository
Testing Antigravity IDE & PlatformIO
The primary goal of this project was to test Antigravity IDE alongside PlatformIO and establish a cleaner Git/GitHub workflow, shifting from the standard Arduino IDE.
- Key Concept Differences
Unlike the Arduino IDE, which manages libraries and boards globally, PlatformIO handles them on a per-project basis.- No Global Libraries: Boards, core frameworks, and libraries are declared inside each project. Multiple projects can use different versions of the same library without conflict.
- Strict C++: Arduino
.inofiles are pre-processed automatically. PlatformIO uses standard.cppfiles, requiring explicit header inclusion and standard C++ structure.
- Environment & Extension Setup
Antigravity IDE utilizes the open-source Open VSX marketplace. Install the following two extensions:PlatformIO IDE: Handles toolchains, core frameworks, and libraries automatically.clangd: Provides high-performance C/C++ code completion and error linting.
-
Project Configuration (
platformio.ini)
Every project requires aplatformio.inifile at its root. This file explicitly declares the target hardware and dependencies.Example:
[env:seeed_xiao_rp2040] platform = raspberrypi board = seeed_xiao_rp2040 framework = arduino lib_deps = olikraus/U8g2 @ ^2.35.30 - C++ Code Structure (
src/main.cpp)
When migrating code from Arduino IDE, your main file must conform to standard C++ rules:- Explicit Headers: You must explicitly include
#include <Arduino.h>and any required library headers at the top of the file. - Forward Declarations: Functions must be declared before they are called.
- Entry Point: An explicit
int main()block must handle the hardware initialization loop.
#include <Arduino.h> // Forward declarations void setup(); void loop(); int main() { init(); // Initializes hardware clocks and timers setup(); while (1) { loop(); } return 0; } - Explicit Headers: You must explicitly include
- Toolbar and Terminal Panel
- Core Toolbar Operations (PlatformIO shortcuts located in the bottom status bar of the IDE):
- Build (
✔︎): Compiles the source code. On the first run, PlatformIO automatically downloads the specified boards, core frameworks, and dependencies into a local hidden directory. - Upload (
→): Compiles and flashes the binary image directly onto the connected microcontroller over USB.
- Build (
-
Terminal Panel Contexts (The bottom panel houses distinct terminal tabs. Understanding their context prevents workflow confusion):
Terminal Context Typical Names Purpose & Usage Auto-Pilot (Task) Upload...,Build...Read-only logs. Spawns automatically when clicking ✔︎or→. Do not type here. Safe to close after seeing[SUCCESS].Cloud & Blueprint (System) bash,zshVersion control and OS tasks. Use this exclusively for running gitcommands (git add,git commit) to manage repository history.Hardware Interactive PlatformIO CLI,Device MonitorMicrocontroller interaction. Wired directly to your physical desk setup. Use this tab for serial debugging outputs ( Serial.print) or running explicit PIO commands.
- Core Toolbar Operations (PlatformIO shortcuts located in the bottom status bar of the IDE):
