กลับไปหน้ารวมไฟล์
a-real-tamagotchi-emulator-for-arduino-uno-d84435-en.md

ArduinoGotchi is a real Tamagotchi P1 emulator running in Arduino UNO hardware. The emulation core is based on TamaLib with intensive optimization to make it fit into UNO's hardware that only comes with 32K Flash 2K RAM.

ArduinoGotchi Project Image

The Tamagotchi Emulator is a massive programming achievement for an Arduino Uno. It combines high-resolution graphics, state-machine logic, EEPROM memory saving, and continuous game loops to create a living "virtual pet."

Rendering Graphics

To make the pet look alive, you must use a matrix LCD (like the Nokia 5110 or a 128x64 OLED) instead of a simple 16x2 character display.

  • Sprites: You draw the pet's animations (happy, sad, eating) pixel-by-pixel on a PC, convert them to hex arrays, and store them in the Arduino's PROGMEM (Flash memory).
  • The Display Library: Libraries like U8g2 or Adafruit_GFX handle pushing these hex arrays to the screen rapidly to create animations.

The State Engine

The pet has variables like hunger_level, happiness_level, and health.

  • Over time (using the millis() function), these variables degrade.
  • The user pushes one of three buttons to "Feed," "Clean," or "Play," which restores these variables.
  • Using the EEPROM.h library, the Arduino saves the pet's stats right before you power it off, so the pet "remembers" its state when you turn it back on!

Components

  • Arduino Uno: The game console.
  • Nokia 5110 / OLED Display: The screen.
  • Push Buttons (x3): For interaction.
  • Piezo Buzzer: For "beep" notifications when the pet is hungry.

ข้อมูล Frontmatter ดั้งเดิม

apps: []
author: "garyz-hk"
category: "Gadgets, Games & Toys"
components:
  - "1x Arduino UNO"
  - "3x Tactile Switch, Top Actuated"
  - "1x SSD1306 I2C OLED 128x64"
  - "3x Resistor 1k ohm"
  - "1x Buzzer"
description: "Relive the 90s! Use a graphical LCD and custom sprites to build a fully functional virtual pet that you must feed, clean, and play with."
difficulty: "Advanced"
documentationLinks: []
downloadableFiles:
  - "https://github.com/GaryZ88/ArduinoGotchi"
encryptedPayload: "U2FsdGVkX1+6dmWG1aXaDs5QugYDY7NSN9QgrFPwQknm4gfKYNNfHh6ZwCM7ciS9/Bk+Zq9NaePTxMVdhHY05eJKIJa/jWwVfJrKCtMeMlP64d7Sqnkizb/puP4BtS4j"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/a-real-tamagotchi-emulator-for-arduino-uno-d84435_cover.jpg"
lang: "en"
likes: 14
passwordHash: "08e2f12b69475e44621b4b35d9fbd6d5c1be0d1e595802672f6c5c00bd72cf12"
price: 2450
seoDescription: "Build a real Tamagotchi emulator using Arduino UNO. A nostalgic DIY project for retro gaming fans."
tags:
  - "emulator"
  - "tamagotchi"
  - "games"
title: "A real Tamagotchi emulator for Arduino UNO"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/MJvAr_od06M"
  - "https://www.youtube.com/embed/ab3_0PLWAnc"
views: 37476