Arduino Stopwatch

Digital Stopwatch using Arduino Uno

Apr 17, 2022

4708 views

2 respects

Components and supplies

1

Buzzer

3

Pushbutton Switch, Pushbutton

1

5 mm LED: Green

1

Arduino UNO

1

Alphanumeric LCD, 16 x 2

4

Resistor 330 ohm

1

5 mm LED: Red

1

Jumper wires (generic)

1

Single Turn Potentiometer- 10k ohms

Apps and platforms

1

Arduino IDE

Project description

Code

Code

arduino

Code

arduino

Downloadable files

Circuit Diagram

Circuit Diagram

Comments

Only logged in users can leave comments

deathbytube

2 years ago

This is awesome and works great thank you. but i did have a question for you What would I have to change in the code so that i could use Timer 0 or 2. You mention using a larger prescaler but I have not figured out how to do it yet below is what I've been using but the clock is to fast. Thank you in advance noInterrupts(); // disable all interrupts TCCR2A = 0; // set entire TCCR1A register to 0 //set timer1 interrupt at 1kHz // 1 ms TCCR2B = 0; // same for TCCR1B TCNT2 = 0; // set timer count for 1khz increments OCR2A = 512; // = (16*10^6) / (1000*8) - 1 //had to use 16 bit timer1 for this bc 1999>255, but could switch to timers 0 or 2 with larger prescaler // turn on CTC mode TCCR2B |= (1 << WGM21); // Set CS11 bit for 8 prescaler TCCR2B |= (1 << CS21); // enable timer compare interrupt TIMSK2 |= (1 << OCIE1A); interrupts(); // enable