Still can't send email.
Your compiling problem:
unsigned int segdisp = {63,6,91,79,102,109,125,7,127,111};
to
unsigned int segdisp[10] = {63,6,91,79,102,109,125,7,127,111};
actuall ytake the entire code, who knows what else was stuffed up in the PM
#define SECONDS 4
#define MINUTES 2
#define HOURS 0
#define TRUE 1 // these may cause an error if already defined
#define FALSE 0
#define BUTTON 5 // push button on pin 5
unsigned int latchpin = 8; // connect to pin 12 on the '595
unsigned int clockpin = 12; // connect to pin 11 on the '595
unsigned int datapin = 11; // connect to pin 14 on the '595
unsigned int speed = 1000; // used to control speed of counting
unsigned int ticks = 0;
unsigned int seconds = 0;
unsigned int minutes = 0;
unsigned int hours = 0;
unsigned int digits[6];
unsigned int button_state = HIGH;
unsigned long time_but_pressed;
unsigned int timing = FALSE;
unsigned int segdisp[10] = {63,6,91,79,102,109,125,7,127,111};
void setup() {
pinMode(latchpin, OUTPUT);
pinMode(clockpin, OUTPUT);
pinMode(datapin, OUTPUT);
}
void loop(){
ticks++;
if (ticks > 9) {
ticks = 0;
seconds++;
if (seconds > 59) {
seconds = 0;
minutes++;
}
if (minutes > 59) {
minutes = 0;
hours++;
}
if (hours > 23) {
hours = 0;
}
}
digits[SECONDS+1] = seconds % 10; // 5 1s
digits[SECONDS] = seconds / 10; // 4 10s
digits[MINUTES+1] = minutes % 10; // 3 1s
digits[MINUTES] = minutes / 10; // 2 10s
digits[HOURS+1] = hours % 10; // 1 1s
digits[HOURS] = hours / 10; // 0 10s
if (digitalRead (BUTTON) == HIGH)
timing = TRUE;
else
timing = FALSE;
if (timing == FALSE) {
writeDigits(1);
} else {
if (ticks == 0) writeDigits(2);
}
delay (100);
}
void writeDigits (int xx) {
digitalWrite(latchpin, LOW);
for (int x = 0; x < 6; x++)
shiftOut(datapin, clockpin, MSBFIRST, segdisp[digits[x]]);
digitalWrite(latchpin, HIGH);
}