Clock functionality. More...
Functions | |
char | getHours (void) |
Get the clocks hours. | |
char | getMins (void) |
Get the clocks minutes. | |
char | getSecs (void) |
Get the clocks seconds. | |
void | setClock (char h, char m, char s) |
Set the clock. | |
void | setClockPosition (char l, char p) |
Set the clock position. | |
void | hideClock (void) |
Hide the clock. | |
void | showClock (void) |
Show the clock. | |
void | clockISR (void) |
void | initClock (void) |
Initialize the clock. |
Clock functionality.
Functionality for keeping time and showing time on the LCD.
char getHours | ( | void | ) |
Get the clocks hours.
Returns the number of hours on the clock.
char getMins | ( | void | ) |
Get the clocks minutes.
Returns the number of minutes on the clock.
char getSecs | ( | void | ) |
Get the clocks seconds.
Returns the number of seconds on the clock.
void hideClock | ( | void | ) |
Hide the clock.
Hides the clock.
void initClock | ( | void | ) |
Initialize the clock.
This routine initializes the clock functionality. It configures timer0 and dispatches the clock interrupt service routine using the Dwengo interrupt library. The clockISR is called every second to update the time. If the clock is visible, the routine also will print the updated time on the LCD in the position set by the setClockPosition().
void setClock | ( | char | h, |
char | m, | ||
char | s | ||
) |
Set the clock.
Sets the clock's hours, minutes and seconds.
h | The new value for the clocks hours. |
m | The new value for the clocks minutes. |
s | The new value for the clocks seconds. |
void setClockPosition | ( | char | l, |
char | p | ||
) |
Set the clock position.
Sets the position at which the clock is shown on the LCD.
l | The line number (0 or 1). |
p | The horizontal position (0 to 15). |
void showClock | ( | void | ) |
Show the clock.
Shows the clock.