A fun and nostalgic digital clock featuring Mario walking across a circular display to interact with time digits!
This project transforms a 240x240 circular GC9A01 display into an interactive Mario-themed clock. Mario walks across the screen and "hits" each digit as time updates, creating a playful animation reminiscent of classic Mario games.
- Animated Mario Character: Mario walks across the screen and jumps to hit time digits
- Dynamic Digit Bounce: Digits bounce when hit by Mario, creating satisfying feedback
- Circular Display: Utilizes a GC9A01 circular TFT display for an elegant presentation
- WiFi Time Sync: Automatically synchronizes time via NTP (Network Time Protocol)
- Customizable: Support for 12/24-hour format and timezone configuration
- Custom Fonts: Uses Gamtex fonts for clear, retro-style time display
- Microcontroller: ESP32-C3
- Display: GC9A01 240x240 Circular TFT
- Connections:
- TFT_BL (Backlight): Pin 3
- TFT_RST (Reset): Pin 1
- TFT_CS (Chip Select): Pin 10
- TFT_DC (Data/Command): Pin 2
- TFT_SCLK (Clock): Pin 6
- TFT_MOSI (Data): Pin 7
- Arduino IDE with ESP32 support
- Arduino_GFX Library
- Clone this repository
- Install the Arduino_GFX library via Arduino IDE Library Manager
- Update WiFi credentials in
mario_ur.ino:const char* ssid = "Your Wi-Fi Network"; const char* password = "Your Password";
- Configure timezone offset (GMT offset in seconds):
const long gmtOffset_sec = 3600; // Adjust for your timezone
- Upload to your ESP32-C3
mario_ur.ino- Main sketch with animation logic and display controlassets.h- Mario sprite graphics and tile dataGamtex26pt7b.h- 26pt font for time displayGamtex8pt7b.h- 8pt font for additional text
Change USE_24H to switch between 24-hour and 12-hour formats:
#define USE_24H 1 // Set to 0 for 12h modeModify the NTP server if needed:
const char* ntpServer = "pool.ntp.org";Adjust Mario sprite size (32 or 16 pixels):
#define MARIOSPRITESIZE 32- Time Synchronization: On startup, the ESP32 connects to WiFi and syncs with an NTP server
- Display Rendering: The circular display shows the current time with animated digits
- Mario Animation: Mario walks across the screen from left to right
- Digit Interaction: When Mario reaches a time digit, he jumps and "hits" it, triggering a bounce animation
- Continuous Loop: The animation repeats as time updates
This project is provided as-is for educational and personal use.
Feel free to fork, modify, and improve! Some ideas:
- Add different animation frames or characters
- Implement additional interactive features
- Add temperature or weather display
- Create different visual themes
Enjoy your Mario Clock! 🍄⏰
