LIGHTSWITCHERS

by OrionHKU in Circuits > Arduino

2453 Views, 12 Favorites, 0 Comments

LIGHTSWITCHERS

ITTT FILM
IMG_20220610_144751.jpg

This is my entry for If This Then That.

Lightswitchers is a 1v1 pvp game where you try to pull the light towards your side by spamming your button as fast as possible.

Supplies

Materials:

1x Arduino Uno R3
2x Button
3x Green LED
4x Red LED
7x 220O Resistor
2x 10kO Resistor

Tools:

Weld Machine
Wood Glue

Conceptualization

Early on the project i wasn't sure what to make but as I talked to schoolmates I started to like the idea of a competitive game where you battle another human. As I didn't want to make the most complex game, this seemed like a good compromise for my current skill in Arduino and the idea I wanted to indulge myself in.

Circuit Setup

187f5e2df09690a13ce2a1fdb4349ce8.png

The circuit can end up quite disorganized so it could be advised to tape all the LED wires together. All LEDs have a 220O resistor and the buttons have a 10kO resistor.

Code

The code makes sure the game always starts at light 4. When a button is pressed, a row of IF statements initiate to check where the current light is, if the if statements sees a light is on, it will turn it off and turn on the light adjacent to it on the button's side. When the light reaches the last green LED. it flashes between the green LED it got to, and the center one, showing the winner.

Downloads

Cutting

laser.png

This is the Illustrator file for laser cutting if you'd want to do that. All sides have to be glued except for the top part, which is the lid. Make sure to use tape or something alike to keep the LEDs in place in the holes. The button's will sit loosely, but this is fixable with an extra wooden beam or some tape. It's not a big issue however, as the buttons won't get out of the holes to push them.

Contemplation

IMG_20220610_144804.jpg
IMG_20220610_145032.jpg

This project has been rough for me, and though i won't be doing any more Arduino stuff in the coming years. I think it has helped me gain an understanding for they way products are made and small machinery works (like toys). Making the box was also very satisfying. If i ever need to make some hardware, at least I understand it's basic principles. I also have a fun game to play with anyone around.