solved! nothing to see here. Thank You!
I am looking to do something similar, but with 6 7seg. I found this thread that ended a bit strange but might have the info you need if you can understand it. I am new to programming and have much to learn before I can conquer this one...
hope this helps,
captainsource:
here: add a timer thru a button,30 sec, to count down for the 4 7seg. displays. First two are minutes and last two are seconds. it jsut cant seem to work; i am thinking some problem with the last inputs for the last piece of codes.
you have a lot of code here, I would urge you to simplify with an array and a little bit mask.
Think of this:
B00000000
as this:
B0GFEDCBA
so a mask like this:
B01111011
lites leds G,F,E,D, ,B and A
since the C is is zero... it won't get lit!
take a look and try to understand it:
byte myLedPin[7] = {5,7,9,11,12,6,8}; //pins A<B<C<D<E<F<G
byte digits[10] = { B01111110, B00110000, B01101101, B01111001, B00110011, B01011011, B01011111, B01110000, B01111111, B01111011 };
void setup()
{
for (int i = 0; i < 7; i++)
{
pinMode(myLedPin[i], OUTPUT);
}
}
void loop()
{
for (int i = 0; i < 10; i++)
{
displayMyNumber(i);
delay(1000);
}
clearSegments();
}
void displayMyNumber(byte myDigit)
{
for (int i = 0; i < 7; i++)
{
digitalWrite(myLedPin[i], bitRead(digits[myDigit], i));
}
}
void clearSegments()
{
for (int i = 0; i < 7; i++)
{
digitalWrite(myLedPin[i], LOW);
delay(1000);
}
}