Setti inn allar skrár frá Project 3 og bætti við overlay í samræmi við controlloerinn og pin out.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user