Program adjusts itself alter 1 run

hello, i made a buzzer system for competitive airsoft games (speedqb) and the first cycle it runs perfectly fine and after the 1st game is done its made to reset itself. now all the games after that where its electrically reset (via reset pin) theres some extra action wich throws off the whole game (after start beep it beeps again wich would simulate the end of the game)

code:

const int horn = 8;
const int start = 10;

int buttonState = 0;
int startState = 0;

void setup() {

pinMode(horn, OUTPUT);
pinMode(start, INPUT);

}

void loop() {

startState = digitalRead(start);

if (startState == HIGH) {

delay(3000);

digitalWrite(horn, HIGH);   //start -30 sec
delay(50);
digitalWrite(horn, LOW);

delay(10000);

digitalWrite(horn, HIGH);   //start -20 sec
delay(50);
digitalWrite(horn, LOW);

delay(10000);

digitalWrite(horn, HIGH);   //start -10 sec
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);  //start -5 sec
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(50);
digitalWrite(horn, LOW);

delay(1000);

digitalWrite(horn, HIGH);
delay(1000);
digitalWrite(horn, LOW);


delay(90000);             //end
digitalWrite(horn, HIGH);
delay(1500);
digitalWrite(horn, LOW);

} else { 

digitalWrite(horn, LOW);

}

}

take a piece of paper and draw how things are wired/powered, post a picture here, and explain a bit more how the reset happens

cant really remember but its 2 buttons in parallel connected to a relay signal pin, that relay switches the horn and gives signal to another relay that gives signal to the reset pin, the last relay also switches the horn but that one is controlled by the arduino (pin 8) had to do it like this because it would be 2 programs running on 1 arduino

and we are supposed to guess?

wiring does not matter here, its software related. once the arduino has been reset with reset pin it alters the program
thats the problem

I’ve never seen this. I press on the reset button quite frequently…

wiring does not matter here, its software related

OK seems you know where the problem is and don’t need help…

thx, you have been of no help

How do you know it’s software related? A reset is a reset, but not a cold boot so if you have things attached then wiring matters. I’m out, good luck.

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