fine frequency control of PWM

Status
Not open for further replies.

JBeale

Well-known member
Right now I am generating a 24 Hz waveform at 12.5% duty cycle on a T3.1 using

Code:
analogWriteFrequency(POUT, 24);
analogWrite(POUT, 32);

and this works as expected. Now however, it seems that I really want about 23.1 Hz instead of 24 Hz. Is there a straightforward way to get higher resolution at lower PWM frequencies?

EDIT: Nevermind! I didn't realize that analogWriteFrequency takes a floating-point argument. It actually just works.
 
Last edited:
Status
Not open for further replies.
Back
Top