Mini Arcade Cyclone Game
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
from here you can see a demo
Getting Started With Modeling
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
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
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
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
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
- 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.
- Connect Arduino Mega: Use a USB cable to connect your Arduino Mega to your computer.
- 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.
- Paste Code: Copy the provided code and paste it into the Arduino IDE window, replacing any existing code.
- 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.
- 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
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!