Skip to content

Commit

Permalink
Merge pull request #3 from leon4413/resolution_fix
Browse files Browse the repository at this point in the history
Resolution Fix
  • Loading branch information
flybrianfly committed Dec 22, 2023
2 parents 70a3e9f + d555b53 commit 664d09d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class PwmTx {
explicit PwmTx(const std::array<int8_t, N> &pins) : pins_(pins) {}
void Begin() {
Begin(pwm_freq_hz_);
analogWriteResolution(RES_);
}
void Begin(const float freq) {
pwm_period_us_ = 1.0f / freq * 1000000.0f;
analogWriteResolution(RES_);
/* Set the period and frequency */
for (std::size_t i = 0; i < N; i++) {
analogWriteFrequency(pins_[i], freq);
Expand Down

0 comments on commit 664d09d

Please sign in to comment.