"Try Your Luck" Arcade Game With Fusion 360

by Coolrobot in Circuits > Arduino

287 Views, 2 Favorites, 0 Comments

"Try Your Luck" Arcade Game With Fusion 360

Photo on 3-3-24 at 12.51 PM.jpg

This simple arcade game detects when you press the button, and then "flips a coin" to see if you won or lost. HAVE FUN!!

Supplies

Screenshot 2024-03-03 at 11.23.59 AM.png
Screenshot 2024-03-03 at 11.43.57 AM.png
Screenshot 2024-03-03 at 11.45.38 AM.png
Screenshot 2024-03-03 at 11.48.43 AM.png
Screenshot 2024-03-03 at 11.51.33 AM.png
Screenshot 2024-03-03 at 12.02.30 PM.png
Screenshot 2024-03-03 at 12.03.11 PM.png

Popsicle sticks, Arduino Nano, male to female jumper wires, red led, green led, Colorful square tactile button, hot glue gun

Design in Fusion 360

Screenshot 2024-03-03 at 12.07.47 PM.png

Using Fusion 360, I created a rough design of my project. If you are new to fusion 360, I highly suggest you check it out. it is a great way to design anything you could possibly need for a project. I have a button in the middle, and a decent sized slot at the top to display if you won or you lost using LEDs.

Photo on 3-3-24 at 11.33 AM.jpg
Photo on 3-3-24 at 11.39 AM.jpg

While closely following the original Fusion 360 model, create an enclosure for the electronics out of popsicle sticks like shown above. I used hot glue as the adhesive for this. you could also 3d print the Fusion 360 design if you have access to a 3d printer. I highly suggest leaving the back panel open so that it is easier to put in the electronics.

The Electronics

Photo on 3-3-24 at 12.04 PM #2.jpg
Photo on 3-3-24 at 12.16 PM #3.jpg
Photo on 3-3-24 at 12.30 PM.jpg
Photo on 3-3-24 at 12.35 PM.jpg

Push the Arduino Nano into the breadboard. on the button, proceed to cut off two of the prongs that are on one side. then glue the button onto the popsicle sticks as shown above. wire the button to D11 of the Arduino Nano, and GND. Proceed to glueing LEDs as shown above. Wire the red LED to D11 and GND, and the green LED to D10 and GND.

The Code

For the final step, upload the code to the Arduino, and have fun!

Code:


// C++ code

//

int Randomizer = 0;


void setup()

{

 pinMode(12, INPUT);

 pinMode(10, OUTPUT);

 pinMode(11, OUTPUT);


 Randomizer = 0;

}


void loop()

{

 if (digitalRead(12) == HIGH) {

  Randomizer = random(1, 2 + 1);

  if (Randomizer == 1) {

   digitalWrite(10, HIGH);

   digitalWrite(11, LOW);

  } else {

   digitalWrite(11, HIGH);

   digitalWrite(10, LOW);

  }

  delay(5000); // Wait for 5000 millisecond(s)

 }

}