LED Maestro
Senior Member
Hi,
I have built myself a binary clock to read seconds, minutes and hours from DS1307 into a pic 28x2. I am using 20 LED's (7 for the seconds, 7 for the minutes and 6 for the hours) which are multiplexed in 3 rows of 7 (minus 1 for the hours). I currently have a very long piece of code which is basically a never ending list of
if b0 = %00000001 then
high c.0, b.0
endif
if b0 = %00000010 then
high c.1, b.0
low c.0
endif
etc etc. this goes on for all 60 seconds!! My problem is i can't display all the time (hour, minutes and seconds) due to the extreme length of code multiplexing doesn't work as the flicker is visible and it makes the LEDs very dim. I am stuck with the repeating cycle of seconds which is great but I would like to read the whole time!
My question, is there a way to do what i am describing with a much shorter code. I have tried doing loops and increments but my knowledge isn't sufficient in these matters to make it work.
Any suggestions would be greatly apreciated.
Many thanks
I have built myself a binary clock to read seconds, minutes and hours from DS1307 into a pic 28x2. I am using 20 LED's (7 for the seconds, 7 for the minutes and 6 for the hours) which are multiplexed in 3 rows of 7 (minus 1 for the hours). I currently have a very long piece of code which is basically a never ending list of
if b0 = %00000001 then
high c.0, b.0
endif
if b0 = %00000010 then
high c.1, b.0
low c.0
endif
etc etc. this goes on for all 60 seconds!! My problem is i can't display all the time (hour, minutes and seconds) due to the extreme length of code multiplexing doesn't work as the flicker is visible and it makes the LEDs very dim. I am stuck with the repeating cycle of seconds which is great but I would like to read the whole time!
My question, is there a way to do what i am describing with a much shorter code. I have tried doing loops and increments but my knowledge isn't sufficient in these matters to make it work.
Any suggestions would be greatly apreciated.
Many thanks