From 2bd45f076ea7eb429bfee54fe1de240ff4b284e6 Mon Sep 17 00:00:00 2001 From: brett Date: Tue, 23 Apr 2024 20:51:02 -0500 Subject: should be finished, backing up --- final_project/clock.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 final_project/clock.c (limited to 'final_project/clock.c') diff --git a/final_project/clock.c b/final_project/clock.c new file mode 100644 index 0000000..7c216fc --- /dev/null +++ b/final_project/clock.c @@ -0,0 +1,31 @@ +/* + * clock.c + * + * Created: 4/3/2024 10:29:19 AM + * Author: bsw9xd + */ +#include "clock.h" + +void timer_init_ctc() { + TCCR1A = 0x00; //WGM10 = 0, WGM11 = 0 (CTC mode when combined with WGM12 in TCCR1B) + TCCR1B = (1 << WGM12); + TCNT1 = 0; // initialize timer at 0 + //TIMSK1 |= (1<