Hi guy’s hope you are all doing well. Yes I think figured out 'Boom Boom' haha
I have final got to point where I think I am beginning to make some progress. Problem is my deadline for this project is tomorrow, so as crap as the code is at the moment, it works to sum degree. I will come back to it very soon to make it the best it can be But for now it will do.
I final managed to make the clock display numbers. Turns out it was the Boolen numbers are back to front ‘0’ would turn the display on and ‘1’ it off so once I swooped them all around I had a clock that would count up.
Now all I had to do was make it count down. I’m sure there is a supper easy way to do this but I just couldn’t figure it out.
Something like for(int i=0; ,i>=0; i--)
But when I tried that nothing happened
So what I have done is reversed the order in which the boolen numbers are in to to count up backwards ‘LOL’ {9, 8 ,7, 6, 5, 4, 3 ,2, 1, 0,} I know its crude but it works
#define LATCH 6
#define DATA 7
#define CLK 5
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//This is the hex value of each number stored in an array by index num
byte digitOne[10]= {B00011001, B00000001, B01111001, B00000011, B00010011, B10011001, B01010001, B01000101, B11111001, B00100001};
byte digitTwo[10]= {B00011001, B00000001, B01111001, B00000011, B00010011, B10011001, B01010001, B01000101, B11111001, B00100001};
byte digitThree[6]= { B00010011, B10011001, B01010001, B01000101, B11111001, B00100001}; // online 6 number for the minets
byte digitFour[10]= {B00011001, B00000001, B01111001, B00000011, B00010011, B10011001, B01010001, B01000101, B11111001, B00100001};
int i;
void setup(){
pinMode(LATCH, OUTPUT);
pinMode(CLK, OUTPUT);
pinMode(DATA, OUTPUT);
}
void loop(){
// Count down
for(int l=0; l<10; l++){
for(int k=0; k<10; k++){
for(int j=0; j<6; j++){
for(int i=0; i<10; i++){
digitalWrite(LATCH, LOW);
shiftOut(DATA, CLK, LSBFIRST, ~digitFour[i]); // digitTwo
shiftOut(DATA, CLK, LSBFIRST, ~digitThree[j]); // digitOne
shiftOut(DATA, CLK, LSBFIRST, ~digitTwo[k]); // digitTwo
shiftOut(DATA, CLK, LSBFIRST, ~digitOne[l]); // digitOne
digitalWrite(LATCH, HIGH);
delay(5);
if(i+j+k+l);=0{ // this code dose not work im not sure why
digitalWrite(LATCH, LOW);
shiftOut(DATA, CLK, LSBFIRST, B11111111,); // digitTwo
digitalWrite(LATCH, HIGH)
delay(1000000);
}
}
}
}
}
}
//That's all for shift registers!
Now all I need is a little bit of to stop the clock when it gets to ‘0’ so It doesn't go 99:99 agiain
Also a little bit of code to start the clock of in the first place would be nice. Like a push to start button.
Hope you Guys can help me with this final task, would be much appreciated