กลับไปหน้ารวมไฟล์
nano_vaders-cf9424-en.md

There are a few Space Invader games available for Arduino. I got motivated to try and improve on the current ones. I wanted to use a larger screen so I decided to use a 2.7 Inch OLED. I increased the number of Rows and Columns to match the Original Taito Space Invaders. I have added a FPS display so you can see what it's running at.

I decided to use the Nano Every as I needed the Extra Ram for the extra aliens on the screen. It's also nice to have the increased Clock speed on the Nano Every. It has a 20 Mhz clock. I did have to go back to the Standard Tone.h library as ToneAC.h does not support the Nano Every yet.

I used Vero Board to assemble the project. I have included a Schematic which can be used to assemble one.

EXPANDED TECHNICAL DETAILS

Retrogaming on a Microcontroller

Nano_Vaders is a clone of the classic Space Invaders game, running entirely on an Arduino Nano.

  • Graphics Engine: Uses a tiny 128x64 I2C OLED display. The game logic handles sprite rendering, collision detection, and screen refresh rates using the Adafruit_SSD1306 library.
  • Input System: Three pushbuttons (Left, Right, Fire) are managed using interrupts or debounced digital reads to ensure responsive gameplay.

Optimization Logic

To fit a full game into the 32KB of the Nano:

  • Sprite Mapping: Graphics are stored as bitmaps in PROGMEM (program memory) rather than RAM.
  • Variable Scaling: The game uses fixed-point math instead of floating-point to maintain a high frame rate (30+ FPS) on the 8-bit AVR processor.

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

title: "Nano_Vaders"
description: "Space Invaders for the Nano Every using a 2.7\" OLED Display"
author: "mosc_007"
category: ""
tags:
  - "games"
views: 1435
likes: 1
price: 699
difficulty: "Intermediate"
components:
  - "1x 2.7 Inch 128x64 White OLED display"
  - "1x Soldering iron (generic)"
  - "1x Audio Transducer"
  - "1x Vero Board (Strip Board)"
  - "1x Push Buttons"
  - "1x Arduino Nano Every"
  - "1x Solder Wire, Lead Free"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/83e5afe2-44bf-483e-b851-7cdbcde2f3e2.ino"
documentationLinks: []
passwordHash: "325232124a4b2efc76fe77063a79e5227077dd866597698a5723d68643c71fc9"
encryptedPayload: "U2FsdGVkX1+XB0ZaK1khGN37EpfYd5Ii6ril4qhSTWcnk+Smu9s7c39cPMISyVffmzywxeNiR5/WlJBfuBKJYmXIteXACpuh+f5qAuDZLmI="
seoDescription: "Play Space Invaders on Nano Every with a 2.7\\\\\\\" OLED Display. A classic retro game project for Arduino."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/nano_vaders-cf9424_cover.jpg"
lang: "en"