Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide frequency/duty_cycle API for PwmOut::begin(...). #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
aentinger merged 1 commit into main from fix-168
Dec 13, 2023
Merged

Conversation

Copy link
Contributor

@aentinger aentinger commented Dec 12, 2023

This fixes #168 .

A short example sketch to test this could be:

#include "pwm.h"
PwmOut pwm_freq(3);
void setup()
{
 Serial.begin(9600);
 while (!Serial) { }
 
 if (!pwm_freq.begin(10*1000*1000.0f, 50.0f))
 Serial.println("Error");
}
void loop() {
}

1 MHz ✔️

image

5 MHz ✔️

image

10 MHz ✔️

image

Although the generated frequency wanders ever more off the desired target. FYI @maidnl .

@aentinger aentinger self-assigned this Dec 12, 2023
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Dec 12, 2023
@aentinger aentinger merged commit 7788752 into main Dec 13, 2023
@aentinger aentinger deleted the fix-168 branch December 13, 2023 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add function that takes frequency/duty cycle as arguments for creating PWM signals

AltStyle によって変換されたページ (->オリジナル) /