22/06/2012

Labview clock.

For the last few weeks I have been developing a labview clock from scratch.  It is a fully functional 24 hour clock with a seven segment display as well as options to set an alarm and snooze.

Clock.

Clock Face
The time is calculated from the system clock of the computer.  I used a command called "Get time/date in seconds" which finds the amount of seconds from the 1st of January 1904 00:00 to when it was called.  If I also find the amount of seconds from the 1/1/1904 00:00 to 00:00 of the current day and take it away from the time elapsed til now I can find the amount of seconds that have passed in a day, and thus calculate the time.

If I left the clock like this, it wouldn't reset, so there is an algorithm to reset the clock once it reaches 23:59 each day.

The seven segment displays were created with the array and cluster options in labview.  The array is two dimensional and contains all of the boolean combinations for lighting the LEDs, along with the numbers they are supposed to display.  The individual digits extract these values from the array, and send them to the cluster whichh will light up the specified number.

Alarm.  
The alarm function was created by creating another display where someone could input the time they want it to trigger by turning a dial.  When the current time matched this value, the LED would light up, a message would display and an alarm noise would trigger.

The clock face when the alarm is activated.
The interface to allow the user to set the alarm.


Snooze.
I also decided to add a snooze function to the clock.  The user would be able to extend the alarm between 1 and 60 minutes when it activates.  The user would be able to press "snooze" as many times as they want until they press the "Stop alarm" button, which would reset the alarm back to it's original value.

The interface for setting the snooze time.



There are still some small bits of tidying up to do, but the functionality of the clock is generally complete.  Video to come soon...

No comments:

Post a Comment

Comments: