Page 1 of 1

LED Digital Clock using V4 Digital Clock Example

Posted: Wed Jul 28, 2010 3:42 pm
by gggwww
Hello,

Im using the Version 4 Digital Clock Example written for an LCD and converting it to drive individual 7 Segment LED Displays.

Issue i am having is converting Hours, Minutes and Seconds (declared as Bytes in the example) to individual digits so they can be displayed on the 7 Segment LED Macro

for example if Hours = 12 then I need to separate this into a 1 for Hours "Tens" position and 2 for Hours"Ones" position - same for minutes and seconds.

The LED 7 Segment Macro will not deal with a 2 digit number - wants individual digits.

Thanks for any help

Re: LED Digital Clock using V4 Digital Clock Example

Posted: Wed Jul 28, 2010 3:58 pm
by medelec35
Hello gggwww.
There are quiet a few examples of separate hours minuets etc.
Dutchie_World_Wide has created a nice example and can be found here:
http://www.matrixmultimedia.com/mmforum ... f=2&t=7571

Although using an LCD display, would be easily converted for LED.

Re: LED Digital Clock using V4 Digital Clock Example

Posted: Wed Jul 28, 2010 4:32 pm
by gggwww
Hello
Thanks for the quick reply. I looked through your example and have difficulty following how to do parsing of a 2 digit number to its individual digits.
Is there a straightforward way of doing this in flowcode?
Thanks:)

Re: LED Digital Clock using V4 Digital Clock Example

Posted: Wed Jul 28, 2010 4:37 pm
by Benj
Hello,

number = 35

digit1 = number / 10
digit1 = digit1 MOD 10
digit1 = 3

digit2 = number MOD 10
digit2 = 5

Re: LED Digital Clock using V4 Digital Clock Example

Posted: Thu Jul 29, 2010 1:30 am
by gggwww
Works Great - thanks Ben