Skip to content

aarush8/Embedded-Snake-Game

Repository files navigation

A classic Snake game implemented on custom hardware, featuring an mbed microcontroller, a breadboard for circuit prototyping, a navigation switch for control, and an LCD screen for display. This project demonstrates embedded programming and hardware interfacing for a retro gaming experience.

Features

  • Classic Snake gameplay on a custom hardware setup.
  • Control the snake's movement using a navigation switch (up, down, left, right).
  • Game display rendered on an LCD screen.
  • Implemented on an mbed microcontroller, showcasing embedded system development.
  • Modular code structure for easy understanding and modification.

Hardware Requirements

To build and run this project, you will need the following hardware components:

  • mbed Microcontroller: (e.g., mbed LPC1768, mbed NXP LPC1768)
  • Breadboard: For assembling the circuit.
  • LCD Screen: (e.g., 16x2 or 20x4 character LCD, or a graphical LCD if preferred and code adjusted)
  • Navigation Switch: A 5-way tactile switch (up, down, left, right, select/push).
  • Resistors: (e.g., for LCD contrast, switch pull-ups if needed)
  • Jumper Wires: For making connections on the breadboard.
  • USB Cable: To power and program the mbed.

Software Requirements

  • mbed CLI or mbed Online Compiler: To compile and flash the code to your mbed microcontroller.
  • mbed OS (or mbed Classic if compatible with your board): The framework used for development.

Setup and Installation

  1. Clone the Repository:

    git clone https://github.com/your-username/mbed-Snake.git
    cd mbed-Snake
  2. Hardware Assembly:

    • Connect your LCD screen to the mbed. Refer to the specific LCD's datasheet and mbed's pinout for correct connections (e.g., RS, E, D4-D7, VCC, GND).
    • Connect the navigation switch to digital input pins on the mbed. Ensure you have appropriate pull-up or pull-down resistors if necessary.
    • Connect all components to the breadboard and mbed's power and ground rails.
  3. Compile and Flash (using mbed CLI):

    • Initialize the mbed project:
      mbed deploy
      mbed target <YOUR_MBED_BOARD_NAME> # e.g., NUCLEO_F401RE
      mbed toolchain GCC_ARM
    • Compile the code:
      mbed compile
    • Drag and drop the generated .bin file onto your mbed drive when connected via USB, or use mbed flash if configured.

Usage

Once the code is successfully flashed to your mbed microcontroller and the hardware is correctly assembled:

  1. Power On: Connect your mbed to a power source (typically via USB to your computer).
  2. Start Game: The game should automatically start on the LCD.
  3. Control: Use the navigation switch to steer the snake.
    • Up/Down/Left/Right: Change the snake's direction.
    • (Optional: If you've implemented a pause/start button, use the center click of the nav switch for that).
  4. Objective: Guide the snake to eat the food pellets without hitting the walls or its own tail.

Contributing

Contributions are welcome! If you have suggestions for improvements, bug fixes, or new features, please feel free to:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request. This project is licensed under the MIT License - see the LICENSE file for details.

About

A classic Snake game implemented on custom hardware, featuring an mbed microcontroller, a breadboard for circuit prototyping, a navigation switch for control, and an LCD screen for display. This project demonstrates embedded programming and hardware interfacing for a retro gaming experience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors