Sparkfun 7 Segment Serial Display Clock

Hi,

I am not very good at programming and I was wondering if someone could help me change this code to make the serial 7 segment using (mins:secs) ranging from 1 to 60 mins counting down to 0. When it gets below 1 minute I would like the formation (secs.millsecs) and buzz every second starting from 5 secs.

Thanks!

#define BuzzTIME 1500 //Fuse current duration in milliseconds.
#define Fuss 7 //Pin connected to the Fuse relay.
#define BuzzPin 50 //Connected to the Buzzer or speaker.
#define ArmButt 46 //Pin connected to the ARM button.
#define GoButt 48 //Pin connected to the GO button.
#define SetPot 0 //Analog Pin connected to the Pot.

void setup() {
pinMode(Fuss, OUTPUT);
pinMode(ArmButt, INPUT); // set "ARM" button pin to input
pinMode(GoButt, INPUT); // set "GO" button pin to input
digitalWrite(ArmButt, HIGH); // turn on pullup resistor
digitalWrite(Fuss, LOW); //OPEN the fuse circuit.
digitalWrite(GoButt, HIGH); // turn on pullup resistor
Serial.begin(9600);
delay(10); //Wait for Serial Display startup.
Serial.print("v"); //Reset the display.
// Serial.print("z //Brightness Control.
// Serial.print(0x40,BYTE); //3/4 Intensity.
//Serial.print("w"); //Decimal Point Control.

}

int DownCntr; // down counter (1/10 Secs.)
int Go = 0; // Stopped

//================================================================
void loop() {
if (!digitalRead(GoButt) || !digitalRead(ArmButt)) {
Go = 0; //ABORT !!!
tone(BuzzPin, 440, 1500);
delay(1500);
}

if (Go == 0) {
WaitARM();
WaitGO();
}
ShowTimer();
if (DownCntr > 50) {
if (DownCntr % 10 == 0)tone(BuzzPin, 1000, 50); //Tone every second.
}
else if (DownCntr % 2 == 0)tone(BuzzPin, 1000, 50); //Tone every 1/5 second.

if (DownCntr == 0) {
//------------------ END OF TIMER! --------------------
tone(BuzzPin, 440, BuzzTIME); //Launch audible signal
delay(BuzzTIME);
//------------------------------------------------------
Go = 0;
}
while (millis() % 100); //Wait until the next 1/10 of second.
delay(50);
DownCntr--; // Nick can't play Basketball
}

//----------------------------------------
void WaitGO() {
ShowTimer();
while (digitalRead(GoButt));
Go = 1;
delay(20);
while (!digitalRead(GoButt)); //Debounce GO button.
}

//------------------------------------------------------
void ReadTimer() {
DownCntr = map(analogRead(SetPot), 0, 1023, 5, 60);
DownCntr *= 10;
}
//------------------------------------------------------
void ShowTimer() {
String seconds = String (DownCntr, DEC);
while (seconds.length() < 3)seconds = "0" + seconds; //format to 3 numbers.
Serial.print(seconds); //Write to Display.
Serial.print(" "); //Last digit off.
}

//------------------------------------------------------
void WaitARM() {
while (digitalRead(ArmButt) == 1) {
ReadTimer();

delay(50);
ReadTimer();
ShowTimer(); //Show Digits.
delay(150);
}

Go = 0;
ShowTimer();
tone(BuzzPin, 2000, 150); // NA won't Read this
delay(200);
tone(BuzzPin, 2000, 150);
delay(200);
tone(BuzzPin, 2000, 150);

delay(20);
while (!digitalRead(ArmButt)); //Debounce ARM button.

}

Welcome to the Forum. Please read these two posts:

How to use this forum - please read.
and
Read this before posting a programming question ...
You may also find useful information that would answer your question here:
Useful links - check here for reference posts / tutorials

You have posted code without using code tags. The code tags make the code look like this

#define BuzzTIME      1500  //Fuse current duration in milliseconds.
#define Fuss     7          //Pin connected to the Fuse relay.
#define BuzzPin  50         //Connected to the Buzzer or speaker.
#define ArmButt  46          //Pin connected to the ARM button.
#define GoButt   48          //Pin connected to the GO button.
#define SetPot   0          //Analog Pin connected to the Pot.

void setup() {
  pinMode(Fuss, OUTPUT);
  pinMode(ArmButt, INPUT);        // set "ARM" button pin to input
  pinMode(GoButt, INPUT);         // set "GO" button pin to input
  digitalWrite(ArmButt, HIGH);    // turn on pullup resistor
  digitalWrite(Fuss, LOW);        //OPEN the fuse circuit.
  digitalWrite(GoButt, HIGH);     // turn on pullup resistor
  Serial.begin(9600);
  delay(10);                      //Wait for Serial Display startup.
  Serial.print("v");        //Reset the display.
  //  Serial.print("z      //Brightness Control.
  //  Serial.print(0x40,BYTE);  //3/4 Intensity.
  //Serial.print("w");      //Decimal Point Control.

}

int  DownCntr;                    // down counter (1/10 Secs.)
int  Go = 0;                      // Stopped

//================================================================
void loop() {
  if (!digitalRead(GoButt) || !digitalRead(ArmButt)) {
    Go = 0;                       //ABORT !!!
    tone(BuzzPin, 440, 1500);
    delay(1500);
  }

  if (Go == 0) {
    WaitARM();
    WaitGO();
  }
  ShowTimer();
  if (DownCntr > 50) {
    if (DownCntr % 10 == 0)tone(BuzzPin, 1000, 50); //Tone every second.
  }
  else if (DownCntr % 2 == 0)tone(BuzzPin, 1000, 50); //Tone every 1/5 second.

  if (DownCntr == 0) {
    //------------------ END OF TIMER! --------------------
    tone(BuzzPin, 440, BuzzTIME);  //Launch audible signal
    delay(BuzzTIME);
    //------------------------------------------------------
    Go = 0;
  }
  while (millis() % 100);       //Wait until the next 1/10 of second.
  delay(50);
  DownCntr--;                    // Nick can't play Basketball
}

//----------------------------------------
void WaitGO() {
  ShowTimer();
  while (digitalRead(GoButt));
  Go = 1;
  delay(20);
  while (!digitalRead(GoButt)); //Debounce GO button.
}

//------------------------------------------------------
void ReadTimer() {
  DownCntr = map(analogRead(SetPot), 0, 1023, 5, 60);
  DownCntr *= 10;
}
//------------------------------------------------------
void ShowTimer() {
  String seconds = String (DownCntr, DEC);
  while (seconds.length() < 3)seconds = "0" + seconds; //format to 3 numbers.
  Serial.print(seconds);                         //Write to Display.
  Serial.print(" ");                             //Last digit off.
}

//------------------------------------------------------
void WaitARM() {
  while (digitalRead(ArmButt) == 1) {
    ReadTimer();

    delay(50);
    ReadTimer();
    ShowTimer();                   //Show Digits.
    delay(150);
  }

  Go = 0;
  ShowTimer();
  tone(BuzzPin, 2000, 150);         // NA won't Read this
  delay(200);
  tone(BuzzPin, 2000, 150);
  delay(200);
  tone(BuzzPin, 2000, 150);

  delay(20);
  while (!digitalRead(ArmButt)); //Debounce ARM button.

}

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The "Code: [Select]" feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing.
If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Unless the sketch is too large, it's better if you post your code, rather than attach it. When it's attached, we have to download it, create a folder then open your code in our IDE. And afterwards, the folder remains unless we navigate to the "Temp" folder and manually remove it. It's much easier to just view the code in your post.

Many questions can be answered by reading the documentation which is provided with the IDE, available under the help tab, or online here.

You've already made a thread about this. Twice. In case you forgot

http://forum.arduino.cc/index.php?topic=494140.0

http://forum.arduino.cc/index.php?topic=494136.0

Don't make multiple identical threads. You will not get more help by spamming the forum. In fact, you'll probably get less help by ignoring forum guidelines and annoying those who would otherwise help you.

Also, use code tags.

Threads merged.

  while (!digitalRead(ArmButt)); //Debounce ARM button.

That is NOT what that code does. If you are going to have useless comments, you MUST make them correct useless comments.

Hi 9069. Im guessing your a kid who is starting out and have taken your code directly from Arduino Project Handbook:25 Practicalprojects to get you started by Mark Geddes. (yes this took 3 seconds to find with the mighty power of a seach engine!)

I also imagine that you really didn't need your fledging skills and confidence rattled by PaulS who seems to have forgotten what it is like to be new and learning something. If PaulS bothered to think rather than bully the Newbie, he would notice that his overly aggressive statement should be directed at the book author the code was copied from .....Mark Geddes. PaulS may need to take a cold DiscoShower and cool off!

9069, unfortunatly my knowledge is limited and all I can offer for you to try is "Serial7Segment.print("0822"); //Send the hour and minutes to the display" beyond that, I am unable to assist you with your request, however, I bothered to read past the first few lines as I was willing to offer assistance if I could. I apologise for the lack of decorum others may have displayed in this thread and I wish you the best for your project and the many others that may follow.