Skip to content
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

Cant set PWM frequency #249

Open
1 task done
nsmith1024 opened this issue Jul 5, 2024 · 3 comments
Open
1 task done

Cant set PWM frequency #249

nsmith1024 opened this issue Jul 5, 2024 · 3 comments
Labels
no-issue-activity pending It is a feature/bug-fix request, currently on hold

Comments

@nsmith1024
Copy link

Boards

AMB82-Mini

External Hardware

NONE

Hardware Configuration

Using PWM

Version

latest dev (checkout manually)

IDE Name

Arduino IDE 2.3.2

Operating System

Windows

Auto Flash Mode

Disable

Erase All Flash Memory (16MB)

Disable

Standard Lib

Arduino_STD_PRINTF

Upload Speed

2000000

Description

How do i change the PWM frequency?

I tried using standard the Arduino functions

ledcAttach(PWM_PIN, FREQ, RESOLUTION);
ledcWrite(PWM_PIN,pwm_value);

Both are undefined.

Please tell me how to set the PWM frequency, resolution, and duty cycle.

Thanks

Sketch

ledcAttach(PWM_PIN, FREQ, RESOLUTION);
 ledcWrite(PWM_PIN,pwm_value);

Error/Debug Message

undefined

Reproduce remarks

No response

I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

  • I confirm I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.
@nsmith1024 nsmith1024 added the pending It is a feature/bug-fix request, currently on hold label Jul 5, 2024
Copy link

github-actions bot commented Jul 5, 2024

Hello, hope this message finds you well. Congrats to your first Issue! We will review it as soon as possiable. Feel free to have a look at https://www.amebaiot.com/en/ameba-arduino-summary/ for more information

@nsmith1024
Copy link
Author

nsmith1024 commented Jul 5, 2024

There is no example for PWM itself, It shows a tone generator example, and servo example, but those doesnt allow direct control of the PWM.

The proper PWM functions ledcAttach(PWM_PIN, FREQ, RESOLUTION); and ledcWrite(PWM_PIN,pwm_value); are undefined in arduino.

Im trying to control a DC motor (not a servo, and not a stepper) just a regular DC motor using the PWM, where i need to change both the frequency and duty cycle.

Copy link

This issue is stale because it has been open for 14 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity pending It is a feature/bug-fix request, currently on hold
Projects
None yet
Development

No branches or pull requests

1 participant