Kinda new to Arduino

Hi, I've never used this forum before so I'm sorry if I'm not doing this right but I'm trying to simulate a bomb for an digital escape room for one of my classes. The end goal is to have a timer count down and use the buttons to "disarm the bomb" and stop the timer and if the player runs out of time tell them. I want to use a specific sequence of button presses to do so. So far I have been able to get everything to work except the order of the button presses. For example, I want the player to press the blue button 6 times then the red button 7 times followed by the green button 5 times, which would display the ending message. If the player guesses incorrectly I want the timer to keep running and them to be able to guess again.
In my many attempts to get my code to work I added the step that they have to press all 3 buttons at the same time when they are done pressing the sequence to signify that they are done. As of right now my code does everything its supposed to except for the fact that if I press the buttons out of order it still displays the congratulatory message. If anyone can help me change my code so that only the right sequence of button presses displays the congratulatory message I would greatly appreciate it.

#include <LiquidCrystal.h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int bluePin = 7;
int redPin = 6;
int greenPin = 5;
int contrastPin = 3;

long minute = 29;
long second = 59;

int t = 0;
int x = 0;
int y = 0;
int z = 0;

void setup() {
  //set the button pins as inputs
  pinMode(redPin, INPUT_PULLUP);
  pinMode(greenPin, INPUT_PULLUP);
  pinMode(bluePin, INPUT_PULLUP);

  analogWrite(contrastPin, 50);

void loop() {
  if (t == 0){
  second = second - 1;

  if (second < 00){
    minute = minute - 1;
    second = 59;

if (second < 10 && minute >= 10){

if (minute < 10 && second >= 10){

if (minute < 10 && second < 10){
  if (minute < 00){
    t = 1;
    lcd.print("out of time!");


void combo() {
    if (minute > 00 || second > 00){
      if (digitalRead(bluePin) == LOW){
      if (digitalRead(redPin) == LOW){
      if (digitalRead(greenPin) == LOW){

    if (digitalRead(bluePin) == LOW && digitalRead(redPin) == LOW && digitalRead(greenPin) == LOW){
        if (x != 7 || y != 8 || z != 6){
            lcd.print("That's not right");
            lcd.print("try again.");
            x = 0;
            y = 0;
            z = 0;
          } else {
              lcd.print("President Auon");
              lcd.print("has been saved!!");
              t = 1;

Also I'm not sure if its my code or if my buttons are just bad, but one press of the button doesn't always register on the display so I usually have to spam it until the number is correct or just press and hold so if someone could help me get the display to register one button press as just that it would be great.

I also don't know which red board and bread board I have but I've attached a picture and the wiring for my set up is as follows (sorry again if this is in the wrong format):


A15 - A30

Wires from

E15 - (-)

E16 - (+)

E17 - pin3

E18 - pin13

E19 - (-)

E20 - pin12

E25 - pin11

E26 - pin10

E27 - pin9

E28 - pin8

E29 - (+)

E30 - (-)

Blue Button

E1 - H1

E3 - H3

Wires from

I1 - pin7

I3 - (-)

Red Button

E6 - H6

E8 - H8

Wires from

I6 - pin6

I8 - (-)

Green Button

E11 - H11

E13 - H13

Wires from

I11 - pin5

I13 - (-)

Wires from

1(+) - 5V

1(-) - GND

Scanned Documents.pdf (893 KB)

Well done using code tags! Using the autoformat function in the IDE ads spices to the dinner.
Please post a proper wiring diagram. That PDF is like a jungle of cables.

The picture was just to show my red and bread board. I'm not sure how to make a wiring diagram, thats why at the end of the post I explain how my circuit was set up. If you can't make sense of that, can you tell me how to make a diagram?

Just use pen and paper and draw the diagram. Try to make a good contrast. Set out pin names, power supply etc.

Is this better?

IMG_1A9BBBF62672-1.pdf (562 KB)

Ehh.. You tried hard.. I'm sure You must have seen wiring diagrams in life. Your diagram would be perfect for wire wrapping! But not for reading an understanding Your project.
Pin numbers are good but in a diagram the "names" of the pins are showed. Don't forget to write what circuit it is, and show the power supply. You can't imagine how often the power supply is the reason for trouble in many projects.

There are ways to make pictures show up in the topic but as I'm not an expert I drop that request....

I have a spark fun redboard Qwiic DEV-15123. Its powered by my computer through what I'm 99% sure is a micro-usb. I have the sparkfun inventors kit version 4.1a if that helps.

Okey. Fine using USB from a computer. I hope You will not hook up any beefy motors to the controller.

I'm not familiar with the devices You tell about, and it's more then bedtime here so I have to take a break.
Post links to them, or a picture if that's informative.

This should link all the products I used, but thanks for trying to help.

Okey. Thanks but I don't want to dig into a supermarket of stuff.
Cheers until tomorrow.

Did you do all 5 of the projects in their guidebook?

If not, I would suggest doing so.


This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.