10 minutes 7-segment display with start/stop/reset button

can someone help me with my project I don’t know how can I set the codes for reset/start/stop part. I’m done with the countdown timer. I give thanks to those geniuses that helped me with the countdown timer. Here’s my code:

int A = 2;
int B = 3;
int C = 4;
int D = 5;
int s1 = 6;
int s2 = 7;
int s3 = 8;
int s4 = 9;
int dig1 = 1;
int dig2 = 0;
int dig3 = 6;
int dig4 = 0;
int sec;
int DTime = 1;
void setup() {
// put your setup code here, to run once:
pinMode(A, OUTPUT);
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(s1, OUTPUT);
pinMode(s2, OUTPUT);
pinMode(s3, OUTPUT);
pinMode(s4, OUTPUT);
}

void pickNumber(int x){
switch(x){
case 1: one(); break;
case 2: two(); break;
case 3: three(); break;
case 4: four(); break;
case 5: five(); break;
case 6: six(); break;
case 7: seven(); break;
case 8: eight(); break;
case 9: nine(); break;
default: zero(); break;
}
}

void one()
{
digitalWrite( A, HIGH);
digitalWrite( B, LOW);
digitalWrite( C, LOW);
digitalWrite( D, LOW);
}

void two()
{
digitalWrite( A, LOW);
digitalWrite( B, HIGH);
digitalWrite( C, LOW);
digitalWrite( D, LOW);
}

void three()
{
digitalWrite( A, HIGH);
digitalWrite( B, HIGH);
digitalWrite( C, LOW);
digitalWrite( D, LOW);
}

void four()
{
digitalWrite( A, LOW);
digitalWrite( B, LOW);
digitalWrite( C, HIGH);
digitalWrite( D, LOW);
}

void five()
{
digitalWrite( A, HIGH);
digitalWrite( B, LOW);
digitalWrite( C, HIGH);
digitalWrite( D, LOW);
}

void six()
{
digitalWrite( A, LOW);
digitalWrite( B, HIGH);
digitalWrite( C, HIGH);
digitalWrite( D, LOW);
}

void seven()
{
digitalWrite( A, HIGH);
digitalWrite( B, HIGH);
digitalWrite( C, HIGH);
digitalWrite( D, LOW);
}

void eight()
{
digitalWrite( A, LOW);
digitalWrite( B, LOW);
digitalWrite( C, LOW);
digitalWrite( D, HIGH);
}

void nine()
{
digitalWrite( A, HIGH);
digitalWrite( B, LOW);
digitalWrite( C, LOW);
digitalWrite( D, HIGH);
}

void zero()
{
digitalWrite( A, LOW);
digitalWrite( B, LOW);
digitalWrite( C, LOW);
digitalWrite( D, LOW);
}

void loop() {
digitalWrite( s1, HIGH);
digitalWrite( s2, HIGH);
digitalWrite( s3, HIGH);
digitalWrite( s4, HIGH);
dig1 = 1;
dig2 = 0;
dig3 = 0;
dig4 = 0;
for(dig1 = 0; dig1 >= 0; dig1–){
for(dig2 = 9; dig2 >= 0; dig2–){
for(dig3 = 5; dig3 >= 0; dig3–){
for(dig4 = 9; dig4 >= 0; dig4–){
for(sec = 1; sec <= 50; sec++){
digitalWrite( s4, LOW); //digit 4
pickNumber(dig4);
delay(DTime);
digitalWrite( s4, HIGH);

digitalWrite( s3, LOW); //digit 3
pickNumber(dig3);
delay(DTime);
digitalWrite( s3, HIGH);

digitalWrite( s2, LOW); //digit 2
pickNumber(dig2);
delay(DTime);
digitalWrite( s2, HIGH);

digitalWrite( s1, LOW); //digit 1
pickNumber(dig1);
delay(DTime);
digitalWrite( s1, HIGH);
}
}
}
}
}
}

Hi and welcome.

I have bad news for you. They were not geniuses and that code is not very good. It will be almost impossible to make start/stop/reset work with this code. You need to start over. But we will help.

But before we start, when you post code on this forum, you should always use code tags so it looks like this. Use the </> icon. Please edit your post above and put the code tags in.

Next, please post a schematic diagram showing how you have your display and buttons connected. This can be hand-drawn and photographed or scanned, provided that it is neat and readable. If you want to use Fritzing, please use the “Schematic View” not the “Breadboard View”.

Paul

Hey!

Here's a terrific idea!

Read the instructions!

i have the same problem too... did solve it?

mkoziev: i have the same problem too... did solve it?

The guy has one post, over two years ago