How stefan-dnc/arduinogameconsole works
Main Components
• Hardware Layer:
• ATMega328P microcontroller as the central processing unit.
• Peripheral devices:
▪ ST7735 LCD Display (communication via SPI)
▪ Joystick (analog inputs + digital button)
▪ Push Button (with debouncing logic)
▪ Buzzer (PWM output through resistor)
▪ 6V Battery Pack (power supply)
• Software Layer:
• Boot module (boot.cpp/.hpp) that likely initializes hardware.
• Game logic components found in game.cpp/game.hpp.
• Entities implemented as classes (Player, Bullet, Enemy, and Settings).
Relationships and Interactions
• Lines connecting the joystick and push button inputs to the microcontroller’s designated pins.
• Buzzer with its PWM connection to the microcontroller.
• For the software structure, show that the boot module initializes settings and peripherals before handing control over to the game module.
Architectural Patterns and Design Principles
• Real-time Processing: Highlight the use of timers and PWM (for both brightness control and debouncing) as critical design elements.
• Communication Protocol: Emphasize the SPI architecture used to update the LCD display.
• Abstraction: Separate hardware-specific code (initialization and control of peripherals) from game logic (collision, scoring, enemy behavior).
Relevant Technologies and Frameworks
• Development environment using Visual Studio Code and PlatformIO.
• C++ as the primary language with libraries such as Adafruit GFX and Adafruit ST7735 for graphics rendering.
• Standard libraries for timers, SPI, and PWM control on the ATMega328P.