A Lightweight, physics-based animation library for robot eyes. Originally designed for the Grobot project, this library utilizes State Machine logic to create organic, smooth, and expressive eye movements on TFT displays.
Optimized for ESP32 using the TFT_eSPI driver (should work on any other supported device).
This library is designed to work within the Arduino IDE ecosystem. Follow these steps to get started:
Before installing this library, ensure you have the TFT_eSPI library installed and properly configured for your specific display and pinout in your User_Setup.h.
you can now install it directly from Arduino Library Manager. Alternatively here is step by step tutorial if you want to install it from this repository.
- Download: Click the green Code button at the top of this repository and select Download ZIP you can also download stable release from Releases Tab.
- Import: In your Arduino IDE, go to Sketch > Include Library > Add .ZIP Library...
- Select: Choose the
.zipfile you just downloaded. - Restart: Restart the Arduino IDE to ensure the Examples are properly indexed.
| Component | Specification |
|---|---|
| Microcontroller | ESP32 (tested with eps32 wroom) or Pi Pico (not yet tested) |
| Display Driver | ILI9341, ST7789, or any driver supported by TFT_eSPI |
| Communication | SPI |
You can trigger different expressions by passing these strings to the setEmotion() function:
- Standard:
NEUTRAL,HAPPY,ANGRY,SAD,EXCITED,ANNOYED,QUESTIONING - Dynamic Idles:
IDLE1,IDLE2,IDLE3
Should work on any device that supports TfT_eSPI library.
BasicEye.inoRunning on an esp32 at 35-39 fps.
src/: Core library files (Grobot_Animations.h,Grobot_Animations.cpp).examples/: ContainsBasicEye.inowhich demonstrates the full cycle of moods along with other Examples.src/Moods.h: Can be used to define custom moods.
To use this library in your own project, simply initialize the GrobotEyes class and call the render function in your main loop.
Note: For flicker-free animations, this library utilizes TFT_eSprite buffers. Ensure your microcontroller has enough RAM to support the sprite size defined in your sketch.
This project is licensed under the MIT License. You are free to use, modify, and distribute this code for personal or commercial projects. See the LICENSE file for details.
Author: Tanmay Wankar
