Mini Arcade Cyclone Game

by Yashashvi Jadaun in Circuits > Arduino

152 Views, 0 Favorites, 0 Comments

Mini Arcade Cyclone Game

WhatsApp Image 2024-03-09 at 8.00.03 PM (1).jpeg

Introducing the simple yet captivating Arcade Cyclone project! Inspired by classic arcade games, this project brings a whirlwind of fun. With its straightforward design and easy gameplay, Arcade Cyclone promises entertainment for all. Let's dive in and enjoy the excitement!

Supplies

First you need these things

Here is a list of materials required for this project:

  • Cardboard
  • 7x7 cm wooden board
  • 14 white LED lights
  • 1 red LED light
  • 1 RGB LED light
  • 1 push button
  • 1 Arduino Mega
  • Jumper cables
  • Power source
  • Colored paper
  • Optional: spray paint
  • FUSION 360 software(optional)
  • NAME OF SUPPLIES
  • drilling machine
  • hand saw
  • markers
  • compass
  • pencil
  • scisors
  • hot glue gun
  • soldering iron
  • soldering wire

What Is It

Project Cyclone By Rudra Jadaun
Project Cyclone

from here you can see a demo

Getting Started With Modeling

Screenshot 2024-03-09 204209.png
Screenshot 2024-03-09 204059.png

Opting for Fusion 360 for its widespread usage in 3D design, I embarked on crafting a basic model for the project. Using a 7 cm radius board as a starting point, I carved out a cylinder and added LED holes. Building a simple structure around it, I also designed a basic box for the button. While it's my first attempt, I'm aware there may be room for improvement in the prototype.

Downloads

Lets Get Into the Circuit

For the circuit we need the following things

arduino mega

14 white led

1 red led

1 rgb led (anode)

jumper wires

soldering iron

soldering wire

The connection

led1 + → arduino mega digital pin 2

led2 + →arduino mega digital pin 3

led3 + → arduino mega digital pin 4

led4 + →arduino mega digital pin 5

led5 + →arduino mega digital pin 6

led6 + →arduino mega digital pin 7

led7 + →arduino mega digital pin 8

led8 + →arduino mega digital pin 9

led9 + →arduino mega digital pin 10

led10 + →arduino mega digital pin 11

led11+ →arduino mega digital pin 12

led12+ →arduino mega digital pin 13

led13+ →arduino mega digital pin 14

led14+ →arduino mega digital pin 15

redled+ →arduino mega digital pin 16

led1 - → ground(gnd)

led2 - →ground(gnd)

led3 - → ground(gnd)

led4 - →ground(gnd)

led5 - →ground(gnd)

led6 - →ground(gnd)

led7 - →ground(gnd)

led8 - →ground(gnd)

led9 - →ground(gnd)

led1- →ground(gnd)

led1- →ground(gnd)

led12- →ground(gnd)

led13- →ground(gnd)

led14- →ground(gnd)

redled- →ground(gnd)

rgbled- → ground(gnd)

rgbled red → arduino mega digital pin 17

rgbled green →arduino mega digital pin 18

rgbled blur →arduino mega digital pin 19

pushbutton 1st side → gnd

pushbutton 2nd side → arduino mega pin 20



Getting the Base

1710068457668.jpg
1710068457954.jpg
1710068458287.jpg
1710068458963.jpg

To create the base for the LEDs, we started with a plywood board measuring 7 cm by 7 cm. Utilizing this board, we formed a circle with a radius of 7 cm. Subsequently, we divided the circumference of the circle into 15 equal parts. At each of these points, we meticulously drew perpendicular bisectors and then crafted holes along these lines to accommodate the LEDs.

Following this meticulous process, I proceeded to cut out the circle and continued with the design phase.

Power Supply

8157fbcc-b1ec-4bbf-beb0-b213f99fd324.jpg
download.jpg
download.jpg
download.jpg

For this project, I utilized a self-made power bank due to its compact size and sufficient power output, capable of running the project for 5-6 hours. There are numerous power sources available for use, including a power bank, charger, 9V power supply, and 9V battery.

for example

1. USB cable connected to a computer or USB power adapter.

2. 9V battery connected to the Arduino's power jack.

3. Wall adapter with appropriate voltage and current ratings.

4. Power bank with a USB output.

5. AA or AAA batteries using a battery holder with a voltage regulator.

  

These options provide straightforward and readily available power sources for this project

Makeing the Body

WhatsApp Image 2024-03-09 at 8.00.03 PM (1).jpeg

In designing the body, I incorporated a circular LED base as previously described. Now, I've taken a cardboard piece measuring 44 cm by 10 cm and positioned it along the circumference of the circular LED base. With this setup, the LEDs can be placed inside the holes, allowing for their proper alignment. All the negative terminals of the LEDs are connected together, while the positive terminals are connected to their designated locations.

Going Into Programmming the Game

hellooooooo.png
sccreenssssshot.png

Now, we proceed to connect the LEDs to the Arduino Mega as outlined in step 2. Additionally, we connect the red LED and RGB LED to the Arduino Mega.

NOW

  1. Open Arduino IDE: Launch the Arduino IDE software on your computer. If you haven't installed it yet, download and install it from this link.
  2. Connect Arduino Mega: Use a USB cable to connect your Arduino Mega to your computer.
  3. Set Board and Port: In the Arduino IDE menu, navigate to Tools > Board. Select Arduino Mega or Mega 2560 from the list. Then, go to Tools > Port and choose the appropriate port for your Arduino Mega.
  4. Paste Code: Copy the provided code and paste it into the Arduino IDE window, replacing any existing code.
  5. Verify Code: Click on the checkmark icon (✓) in the Arduino IDE toolbar to verify the code for any syntax errors. Make sure the code compiles successfully without any errors.
  6. Upload Code: Once the code has been verified, click on the right arrow icon (→) next to the checkmark to upload the code to your Arduino Mega. The Arduino IDE will compile the code and upload it to the connected Arduino

That's it! Your code should now be uploaded to your Arduino Mega, and your project should be ready to run. If you encounter any errors during the upload process, double-check your connections, board settings, and code syntax before trying again.






The Code

// Pin definitions

//this code belongs to @rudrajadaun

//please mention me in use of this code

const int whiteLEDs[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};

const int redLED = 16;

const int buttonPin = 20;

const int redPin = 17;

const int greenPin = 18;

const int bluePin = 19;


// Variables

int currentLED = 0;

bool gameRunning = false;


void setup() {

 // Initialize pins

 pinMode(redLED, OUTPUT);

 pinMode(buttonPin, INPUT_PULLUP);

 pinMode(redPin, OUTPUT);

 pinMode(greenPin, OUTPUT);

 pinMode(bluePin, OUTPUT);

 for (int i = 0; i < 14; i++) {

  pinMode(whiteLEDs[i], OUTPUT);

 }


 // Start game

 Serial.begin(9600);

 startGame();

}


void loop() {

 if (gameRunning) {

  // Chase LEDs

  chaseLEDs();


  // Check button press

  if (digitalRead(buttonPin) == LOW) {

   gameRunning = false;

   stopLEDs();

   // Turn on the stopped LED

   if (currentLED == 13) { // Red LED

    digitalWrite(redLED, HIGH);

    digitalWrite(redPin, LOW);

    digitalWrite(greenPin, HIGH);

    digitalWrite(bluePin, LOW);

   } else { // White LED

    digitalWrite(whiteLEDs[currentLED], HIGH);

    digitalWrite(redPin, HIGH);

    digitalWrite(greenPin, LOW);

    digitalWrite(bluePin, LOW);

   }

   delay(500); // Delay for button debounce

  }

 } else {

  // Check button press to restart game

  if (digitalRead(buttonPin) == LOW) {

   startGame();

   delay(500); // Delay for button debounce

  }

 }

}


void startGame() {

 gameRunning = true;

 currentLED = 0;

}


void chaseLEDs() {

 stopLEDs(); // Turn off all LEDs

 if (currentLED == 13) {

  digitalWrite(redLED, HIGH); // Turn on red LED

 }

 digitalWrite(whiteLEDs[currentLED], HIGH); // Turn on current white LED

 currentLED = (currentLED + 1) % 14; // Move to the next LED

 delay(100); // Adjust delay for speed

}


void stopLEDs() {

 for (int i = 0; i < 14; i++) {

  digitalWrite(whiteLEDs[i], LOW); // Turn off all white LEDs

 }

 digitalWrite(redLED, LOW); // Turn off red LED

}


void gameWon() {

 // Turn on all LEDs for 1 second

 for (int i = 0; i < 14; i++) {

  digitalWrite(whiteLEDs[i], HIGH);

 }

 digitalWrite(redLED, HIGH);

 delay(1000);

 stopLEDs(); // Turn off all LEDs

}


void gameLost() {

 // Blink red LED and turn RGB LED green

 for (int i = 0; i < 2; i++) {

  digitalWrite(redLED, HIGH);

  delay(500);

  digitalWrite(redLED, LOW);

  delay(500);

 }

 // Turn RGB LED green

 digitalWrite(redPin, LOW);

 digitalWrite(greenPin, HIGH);

 digitalWrite(bluePin, LOW);

}

Downloads

Decoration and Getting It to Work

bf242599-3485-4554-bbfb-8cc83421ba4c.jpg
cc173f2d-60d5-451b-b772-e177d20ee05a.jpg
9fcf9a82-fbd4-4cc9-bb8f-a1b5a2e56feb.jpg

Now, let's start decorating. I've covered the cylindrical body with colored paper. Additionally, you can opt to 3D print it for a more polished finish. The circular base has been colored orange using spray paint for a vibrant look. Next, I've placed the button on top of an ice cream stick. The push button is topped with another ice cream stick piece, and I've added a cover made from a marker for a finished touch. Finally, I've placed a circular strip around the circular base, and voila, it's ready!