LED Digital Clock using V4 Digital Clock Example

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
gggwww
Posts: 54
Joined: Wed Sep 09, 2009 12:50 am
Has thanked: 1 time

LED Digital Clock using V4 Digital Clock Example

Post 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

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: LED Digital Clock using V4 Digital Clock Example

Post 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.
Martin

gggwww
Posts: 54
Joined: Wed Sep 09, 2009 12:50 am
Has thanked: 1 time

Re: LED Digital Clock using V4 Digital Clock Example

Post 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:)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED Digital Clock using V4 Digital Clock Example

Post by Benj »

Hello,

number = 35

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

digit2 = number MOD 10
digit2 = 5

gggwww
Posts: 54
Joined: Wed Sep 09, 2009 12:50 am
Has thanked: 1 time

Re: LED Digital Clock using V4 Digital Clock Example

Post by gggwww »

Works Great - thanks Ben

Post Reply