FanController icon indicating copy to clipboard operation
FanController copied to clipboard

AVR only - add optional pwmMode constructor variable, add methods to set and get PWM frequency when using timer based PWM generation

Open Saxin opened this issue 8 months ago • 0 comments

All credit goes to Sam Knight for his FastPWM library - PWM.h https://code.google.com/archive/p/arduino-pwm-frequency-library/downloads https://forum.arduino.cc/t/pwm-frequency-library/114988 https://github.com/RCS101/PWM

Changes summary:

  1. All changes are for AVR platform only.
  2. Added pwmMode constructor variable, 0 - Arduino native PWM, 1 - Timer based Fast PWM with option to change frequency.
  3. Added get / set methods for frequency, units are Hz. bool FanController::setPwmFrequency(int32_t freq) int32_t FanController::getPwmFrequency()
  4. Added example arduino sketch.

Saxin avatar Jun 19 '24 20:06 Saxin