Final: Alt Arcade

Mac Padilla
4 min readMay 3, 2023

For my final project I decided to create a puzzle box that acts as a timed bomb. There are 4 sides to this box that each correspond to a screen on the game. The first screen is instructions which tell you how to play the game. But you only have 60 seconds to complete the bomb.

The first part of the Puzzle is connect wires on the back of the box when you do this the colors will light up and then you will know that you got all of them.

The next page is the dials where all you have to do is turn the dials. There is no order to turn them in, just turn them, and they will work and make the dial on the screen, green.

The last thing you have todo to complete the puzzle is turn the switches in the right order. The right order from right to left is 2nd > 4th > 1st > 3rd. once you do this you win.

Here are the winning screens and the losing screens.

Here is the arduino code for the teensy that i had. It had switches, dials and connections, correspond with letters pressed on the screen.

const int buttonleft = 1;
const int buttonright = 1;

const int connection1 = 5;
const int connection2 = 6;
const int connection3 = 7;
const int connection4 = 8;
const int connection5 = 10;

const int switch1 = A0;
const int switch2 = A1;
const int switch3 = A2;
const int switch4 = A3;

const int knob1 = A5;
const int knob2 = A6;
const int knob3 = A7;
const int knob4 = A8;

void setup() {
Serial.begin(9600);
pinMode(buttonleft, INPUT_PULLUP);
pinMode(buttonright, INPUT_PULLUP);

pinMode(connection1, INPUT_PULLUP);
pinMode(connection2, INPUT_PULLUP);
pinMode(connection3, INPUT_PULLUP);
pinMode(connection4, INPUT_PULLUP);
pinMode(connection5, INPUT_PULLUP);

pinMode(switch1, INPUT_PULLUP);
pinMode(switch2, INPUT_PULLUP);
pinMode(switch3, INPUT_PULLUP);
pinMode(switch4, INPUT_PULLUP);

pinMode(knob1, INPUT_PULLUP);
pinMode(knob2, INPUT_PULLUP);
pinMode(knob3, INPUT_PULLUP);
pinMode(knob4, INPUT_PULLUP);
}

// the loop routine runs over and over again forever:
void loop() {
//int photocell = analogRead(A9);
//Serial.println(photocell);
//delay(10); // delay in between reads for stability



if (digitalRead(buttonleft) == LOW) {
Serial.println("Left");
Keyboard.press(KEY_X);
delay(500);
} else {
Keyboard.release(KEY_X);
}
if (digitalRead(buttonright) == LOW) {
Serial.println("Right");
Keyboard.press(KEY_X);
} else {
Keyboard.release(KEY_X);
}


//if (analogRead(photocell) < 125){
//Keyboard.press(KEY_X);
//} else {
//Keyboard.release(KEY_X);
//}


if (digitalRead(connection1) == LOW) {
Keyboard.press(KEY_T);
} else {
Keyboard.release(KEY_T);
}
if (digitalRead(connection2) == LOW) {
Keyboard.press(KEY_Y);
} else {
Keyboard.release(KEY_Y);
}
if (digitalRead(connection3) == LOW) {
Keyboard.press(KEY_U);
} else {
Keyboard.release(KEY_U);
}
if (digitalRead(connection4) == LOW) {
Keyboard.press(KEY_I);
} else {
Keyboard.release(KEY_I);
}
if (digitalRead(connection5) == LOW) {
Keyboard.press(KEY_O);
} else {
Keyboard.release(KEY_O);
}



if ((digitalRead(switch1) == HIGH) && (digitalRead(switch2) == LOW) && (digitalRead(switch3) == HIGH) && (digitalRead(switch4) == HIGH)) {
Keyboard.press(KEY_H);
} else if ((digitalRead(switch1) == LOW) && (digitalRead(switch2) == HIGH) && (digitalRead(switch3) == LOW) && (digitalRead(switch4) == LOW)) {
Keyboard.release(KEY_H);
}
if ((digitalRead(switch1) == HIGH) && (digitalRead(switch2) == LOW) && (digitalRead(switch3) == HIGH) && (digitalRead(switch4) == LOW)) {
Keyboard.press(KEY_J);
} else if ((digitalRead(switch1) == LOW) && (digitalRead(switch2) == HIGH) && (digitalRead(switch3) == LOW) && (digitalRead(switch4) == HIGH)) {
Keyboard.release(KEY_J);
}
if ((digitalRead(switch1) == LOW) && (digitalRead(switch2) == LOW) && (digitalRead(switch3) == HIGH) && (digitalRead(switch4) == LOW)) {
Keyboard.press(KEY_K);
} else if ((digitalRead(switch1) == HIGH) && (digitalRead(switch2) == HIGH) && (digitalRead(switch3) == LOW) && (digitalRead(switch4) == HIGH)) {
Keyboard.release(KEY_K);
}
if ((digitalRead(switch1) == LOW) && (digitalRead(switch2) == LOW) && (digitalRead(switch3) == LOW) && (digitalRead(switch4) == LOW)) {
Keyboard.press(KEY_L);
} else if ((digitalRead(switch1) == HIGH) && (digitalRead(switch2) == HIGH) && (digitalRead(switch3) == HIGH) && (digitalRead(switch4) == HIGH)) {
Keyboard.release(KEY_L);
}



if (analogRead(knob1) == 100) {
Keyboard.press(KEY_V);
} else {
Keyboard.release(KEY_V);
}
if (analogRead(knob2) == 100) {
Keyboard.press(KEY_B);
} else {
Keyboard.release(KEY_B);
}
if (analogRead(knob3) == 100) {
Keyboard.press(KEY_N);
} else {
Keyboard.release(KEY_N);
}
if (analogRead(knob4) == 100) {
Keyboard.press(KEY_M);
} else {
Keyboard.release(KEY_M);
}



}

Here is the game that you play with it

--

--