Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
v2.1.0 for new PWM_manual example, etc.
Browse files Browse the repository at this point in the history
### Releases v2.1.0

1. Add example [PWM_manual](https://github.com/khoih-prog/Portenta_H7_PWM/tree/main/examples/PWM_manual) to demo how to correctly use PWM to generate waveform. Check [About DCValue in setPWM_manual #2](khoih-prog/AVR_PWM#2)
2. Add function `setPWM_DCPercentage_manual()` to facilitate the setting PWM DC manually by using `DCPercentage`
3. Optimize for PWM speed when changing `dutycycle` while using same `frequency`
  • Loading branch information
khoih-prog committed Jan 26, 2023
1 parent 58b0fae commit 0d6f1a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/PWM_manual/PWM_manual.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void loop()
// Update DC every UPDATE_INTERVAL (1000) milliseconds
if (millis() > update_timeout)
{
//setPWM_DCPercentage_manual(pwm, myPin, dutycyclePercent);
setPWM(pwm, myPin, frequency, dutycyclePercent);
setPWM_DCPercentage_manual(pwm, myPin, dutycyclePercent);
//setPWM(pwm, myPin, frequency, dutycyclePercent);

dutycyclePercent += DCStepPercent;

Expand Down

0 comments on commit 0d6f1a6

Please sign in to comment.