project 2 pasted in to repo

This commit is contained in:
2026-09-24 10:15:22 +00:00
parent fcc0f82dc6
commit 46c761dd25
24 changed files with 1038 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#include "timer_usec.h"
Timer_usec::Timer_usec() = default;
void Timer_usec::init(uint16_t period_us) { // for custom duty cycle duration in ms in part 1
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 0;
OCR1A = period_us * 2 - 1;
TCCR1B |= (1<<WGM12);
TIMSK1 |= (1<<OCIE1A);
TCCR1B |= (1<<CS11);
}