How do I make a AM , PM clock

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Posts: 2
Joined: Thu Aug 03, 2006 8:37 pm

How do I make a AM , PM clock

Postby VirusAlert » Thu Aug 10, 2006 9:02 pm

any ideas?

User avatar
Matrix Staff
Posts: 3073
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 87 times
Been thanked: 387 times

Postby Steve » Fri Aug 11, 2006 11:59 am

Use the TIMER0 interrupt with a suitable crystal clock frequency and prescaler. Update the timer info in the TIMER0 macro, and repeatedly display the time within your main routine.

Posts: 3
Joined: Wed Aug 23, 2006 11:47 pm

Postby rrwoods1978 » Wed Aug 23, 2006 11:51 pm

Can we get that in English please? If we don't even know how to make a clock, then I am thinking we are pretty new to this.

I need to make a standard 12 hour clock with am & pm functions and alam. Also need a way to set the time and alarm using the switch board.

Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time

Postby Ian » Thu Aug 24, 2006 9:35 am

The Timer macro is called at so many times a second e.g 75 times a second or 75Hz.
The prescaler and crystal clock frequency allow you to set the refresh rate to a useable time period such as 75hz that you use.

Count to 75 in the timer interrupt macro and a second has passed.
Update the seconds minutes hours etc. .

The main program can display the time and check for inputs.

12 or 24 hour clock is simply a way to display the 24 hours.