I have been trying to generate two identical PWM signals. Both the signals should have a duty cycle of 33%. The first signal starting at 0us and the other at 0.5us. After watching the tutorials I came up with the following code but the code does not compile.
#include <PWM.h> pinMode(3, OUTPUT); pinMode(11, OUTPUT); TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20); TCCR2B = _BV(CS22); OCR2A = 76; OCR2B = 76;
The way I figured is
Duty cycle A & B= (76+1)/256= 33%. I'd appreciate any help that I can get. Cheers!