GithubHelp home page GithubHelp logo

arduino_game's Introduction

⚡ arduino game


⚠️ Warning

Important: Please read this before proceeding.

When connecting the display, ensure that has a voltage regulator (shown in the image below) before connecting it directly to the 5v logic level of the Arduino. This is because the display could be destroyed if the version of the display you have does not have the regulator.

Remember to exercise caution and proceed at your own risk.If you have any doubts or concerns, consult the manufacturer's documentation or seek assistance from experienced individuals.

Proceed with caution and enjoy the project responsibly!

In this task, i made a simpe game using Arduino. The TFT screen and joystick are connected to the Arduino board using the following pin configuration:

TFT screen:

  • LED: 3.3V
  • SCK: D13
  • SDA (MOSI): D11
  • A0: D8
  • RST: D9
  • CS: D10
  • VCC: 5V
 

game


game over

Joystick pins:

  • GND pin connects to the circuit’s ground.
  • Vcc pin is used to supply the 5-volt power to the module.
  • VRx pin is the analog output pin for X-axis (left and right).
  • VRy pin is the analog output pin for Y-axis (up and down).
  • SW pin is connected to the pull-up button. Once the button is pressed, SW pin outputs 0

Library Installation

To get started, we need to include the Adafruit_ILI9163C library in our Arduino code. Follow these steps to install the library:

  1. Open the Arduino IDE.
  2. Go to "Sketch" -> "Include Library" -> "Manage Libraries".
  3. In the Library Manager, search for "Adafruit_GFX".
  4. Click on the "Adafruit_GFX" library and click the "Install" button.
  5. Wait for the installation to finish.

Usage

To use the code, follow these steps:

  1. Connect the TFT screen and the joystick to the Arduino board according to the provided pin configuration.

  2. Open the Arduino IDE and create a new sketch.

  3. Include the library at the beginning of your code:

    #include <Adafruit_GFX.h>
    #include <Adafruit_ST7735.h>
    
  4. make the pin connections and adjust accordingly

    const int SW = 2; // SW
    const int X = 0;  // VRx
    const int Y = 1;  // VRy
    
    #define TFT_CS   10
    #define TFT_RST  9
    #define TFT_DC   8
    
    
  5. then the rest of the code arduin_game.ino

    void setup(){
    //code
    }
    
    void loop{
    // more code
    }
    
    

arduino_game's People

Contributors

dev-sheikh-ali avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.