Light Catcher Jackpot

by Bilauhl in Circuits > Arduino

266 Views, 1 Favorites, 0 Comments

Light Catcher Jackpot

Screenshot 2023-01-24 15.48.15.png

My name is Bilal, and on this instructable, I'll be showcasing my capstone project. I developed a jackpot LED chaser game for this project which was inspired by the arcade game Cyclone Jackpot. The LEDs will be lighting up/flashing in order due to the way the game operates. You will be given a colour to display on the Arduino's serial monitor. In the case of the supplied, you must press the button while the LED chaser crosses over that colour. A timer that starts counting down from 10 seconds is also included. The game will end if you are unable to prevail in the allotted time. Now, on to the supplies.

Materials

Arduino Uno

5X LEDs (Red, yellow, white, blue and green)

1X push button

Resistors

Wires

1xBuzzer

1X 7SegDisplay

Wiring

Screenshot 2023-01-24 15.48.15.png

The wiring can be completed using the Tinkercad programme and the aforementioned schematic.


Connecting the 7 Segment Display: We need to use this to create the timer for the game.

 pinMode(a, OUTPUT);

pinMode(b, OUTPUT);

pinMode(c, OUTPUT);

pinMode(d, OUTPUT);

pinMode(e, OUTPUT);

pinMode(f, OUTPUT);

pinMode(g, OUTPUT);


LEDS & Button: We will also need use of the LEDs for our flashing lights and our button to catch the jackpot.

pinMode(ledRed, OUTPUT);

pinMode(ledGreen, OUTPUT);

pinMode(ledYellow, OUTPUT);

pinMode(ledBlue, OUTPUT);

pinMode(ledWhite, OUTPUT);

pinMode(push, INPUT); 


Image of Circuit

unnamed (1).jpg

Coding Variables

For 7 Segment:

int g = 7;

 int f = 8;

 int a = 13;

 int b = 12;

 int e = 9; 

 int d = 10;

 int c = 11;


For LEDs:

int ledRed=6;

int ledGreen=5;

int ledYellow=4;

int ledBlue=3;

int ledWhite=2;

int push=A0;

Code Functions

 digitalWrite(LED_BUILTIN, HIGH);

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

 digitalWrite(LED_BUILTIN, LOW);

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

Full Code

int a=13;

int b=12;

int c=11;

int d=10;

int e=9;

int f=8;

int g=7;

int ledRed=6;

int ledGreen=5;

int ledYellow=4;

int ledBlue=3;

int ledWhite=2;

int push=A0;

void setup()


{

 pinMode(a, OUTPUT);

pinMode(b, OUTPUT);

pinMode(c, OUTPUT);

pinMode(d, OUTPUT);

pinMode(e, OUTPUT);

pinMode(f, OUTPUT);

pinMode(g, OUTPUT);

pinMode(ledRed, OUTPUT);

pinMode(ledGreen, OUTPUT);

pinMode(ledYellow, OUTPUT);

pinMode(ledBlue, OUTPUT);

pinMode(ledWhite, OUTPUT);

pinMode(push, INPUT); 

}


void loop()

{

 digitalWrite(LED_BUILTIN, HIGH);

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

 digitalWrite(LED_BUILTIN, LOW);

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

}