Code: Select all
// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU / (IR_CLOCK_RATE * 2L) - 1);
pinMode(pwmPin, OUTPUT);
Any help or pointers would be really appreciated