The M5Stack Core 2 packs a lot of features: a small, charming frame, a lithium battery, a built-in touchscreen, and a built-in accelerometer. I wanted to create something that not only used these features, but also made people smile.
While brainstorming, I recalled xeyes—the nostalgic classic desktop program where an animated pair of eyes follow your mouse cursor. That sparked a thought: What if I could bring that same playful experience to the M5Stack, and make it even more interactive using its built-in sensors?
The result is a cheerful little application where two animated eyes track your fingertip across the screen, and—thanks to the accelerometer—spin in surprise when you give the Core2 a gentle tap.
Features- Touch Tracking — Pupil positions update instantly based on your fingertip’s location.
- Tap Reaction — A quick knock makes the eyes spin 360°.
- Smooth Animation — Rendering optimized for Core2’s LCD.
- Self-Contained — No additional modules required.
- Register an M5Stack Community account if you haven't already.
- Launch the M5Burner .
- Click
USER CUSTOM
in the lower left corner. - Log in to the M5Stack Community.
- Click the
Share Burn
button. - Enter
NOmrydGI4FXocM31
in theShare Code
field. - Click the lightning icon ⚡ .
- Clone the repository:
git clone https://github.com/cubic9com/m5core2_eyes.git
cd m5core2_eyes
- Install Visual Studio Code if you haven't already.
- Open the project in Visual Studio Code:
code .
- Install
PlatformIO IDE
extension: Go to the Extensions view (Ctrl+Shift+X
). Search forPlatformIO IDE
and install it. - Open PlatformIO Home: In the left Activity Bar, click the PlatformIO icon. In the left Primary Sidebar, Go to
QUICK ACCESS > PIO Home > Open
. - Open the project: In the right Editor Groups, Click
Open Project
in thePIO HOME
tab. Select the clonedm5core2_eyes
project folder. - Upload the project: In the left Primary Sidebar, go to
PROJECT TASKS > m5stack-core2 > General > Upload
.
- Touch the display.
- Hit it to spin its eyes.
Comments