Skip to content

JasvinK/Avr-lcd-digital-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVR LCD Digital Clock

Overview

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.


Features

  • Real-time digital clock display
  • Timer interrupt updates every 10ms
  • Displays time in hr:min:sec.milliseconds format
  • Stopwatch functionality using a button input
  • Two synchronized LCD display lines

Hardware

  • Arduino Mega2560
  • HD44780 compatible 2×16 LCD display
  • LCD keypad shield

How It Works

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.


Files

main.c
timer_interrupt.c
button.c
lcd_drv.c
lcd_drv.h
main.h
mydefs.h
CSC230.h

Concepts Demonstrated

  • Embedded systems programming in C
  • AVR timer interrupts
  • LCD display control
  • Analog button input using ADC
  • Timekeeping algorithms

Author

Jasvin Kaur
Computer Science – University of Victoria

About

AVR C program for Arduino Mega2560 implementing a digital clock with timer interrupts, LCD display, and stopwatch functionality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages