Hi! Here is my code:
And here is what I get - 1kHz with 25% duty cycle. If I change the pin to 1, 3 or 5 then those pins output the expected frequency and duty cycle. What am I missing? I am using Serial5 and not using Serial2, at least not in my code, but I suspect it is Serial2 in some way.
Thanks, Andy
Code:
#define REAR_DUMP_PWM 7
#define PWM_FREQUENCY_HZ 120
...
analogWriteFrequency(REAR_DUMP_PWM, PWM_FREQUENCY_HZ);
analogWriteResolution(15); // 0 - 32767
analogWrite(REAR_DUMP_PWM, (int)(32767 * 0.50));
And here is what I get - 1kHz with 25% duty cycle. If I change the pin to 1, 3 or 5 then those pins output the expected frequency and duty cycle. What am I missing? I am using Serial5 and not using Serial2, at least not in my code, but I suspect it is Serial2 in some way.
Thanks, Andy