This project implements a digital clock system using AVR C on an Arduino Mega2560. The program uses timer interrupts to track time and displays the result on a 2×16 LCD display. A button on the LCD keypad shield enables a stopwatch-style feature that pauses and resumes the second display line.
The project demonstrates embedded systems concepts including timers, interrupts, LCD communication, and button input.
- Real-time digital clock display
- Timer interrupt updates every 10ms
- Displays time in
hr:min:sec.millisecondsformat - Stopwatch functionality using a button input
- Two synchronized LCD display lines
- Arduino Mega2560
- HD44780 compatible 2×16 LCD display
- LCD keypad shield
A timer interrupt triggers every 10 milliseconds, updating the time counters:
- Hours
- Minutes
- Seconds
- Milliseconds
The time is formatted and displayed on the LCD screen.
Pressing the SELECT button pauses updates to the second line of the display, creating a stopwatch effect while the first line continues running.
Pressing the button again synchronizes both lines.
main.c
timer_interrupt.c
button.c
lcd_drv.c
lcd_drv.h
main.h
mydefs.h
CSC230.h
- Embedded systems programming in C
- AVR timer interrupts
- LCD display control
- Analog button input using ADC
- Timekeeping algorithms
Jasvin Kaur
Computer Science – University of Victoria