-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
tone generation with ledcSetup and ledcWrite instable under fw 2.0 (was fine with 1.0.6) #6199
Comments
Hi @bongoo1, |
here's the sketch as it actually looks like after i tried a few things more. with platformio.ini containing with platformio.ini containing
instead, there is not beep audible about half of the time. with the code below, call
|
I can confirm this issue. Is ok with 1.0.6. |
I have tested your sketch with Arduino-esp32 master branch and everything is working great :) Some points to your sketch:
If you still have some issue let me know :) |
hi @P-R-O-C-H-Y
does this take version 2.0.2 or what do i need to change there? and about your modification to the code: thanx for your help! |
Actually I am not familiar with PlatformIO settings. I am using Arduino IDE / VS code. But what you can do is to check our docs or this issue link. But I think you are using just 2.0 version of Arduino-esp32. Follow the docs or issue to get latest version ;) If you need some info, what the functions do you can check our docs, ledc api was added recently: ledc docs But some quick explanation for what I understand in your code, I will separate the BeepDo() to some parts:
Hope it helps, but feel free to ask for more help :) |
hi @P-R-O-C-H-Y i too thought that i probably use 2.0.0, but could also be 2.0.2. i was not able to find that out. that's why i asked ;-) and about the code: |
Hi @bongoo1
I think according to your platformio.ini you use 2.0.0. But if change this it should do the thing ;)
to
Actually in 2.0 version I don't know if 254 or 255 will do it for you. In 2.0.2 the LEDC was refactored and now the 255 will do the thing for you.
Your code will work but it can be simplified and if the execution is slower or some interrupt happens there might be some hazards when you want to set fully ON (HIGH) but you call |
hi @P-R-O-C-H-Y
i get this entry for each project where i switch the platform_packages. |
Hi @bongoo1 , |
any updates @bongoo1? |
Hello, as there was no answer in 14 days, I'm closing the issue as expired to keep our backlog manageable. If it's still needed, please reopen the issue. Thanks for understanding. |
Board
esp32dev
Device Description
piezzo beeper connected to gpio33
Hardware Configuration
nothing relevant
Version
v2.0.0
IDE Name
platformIO
Operating System
win10
Flash frequency
default
PSRAM enabled
no
Upload speed
115200
Description
i generate short tones when pressing a key on the keyboard connected using the commands ledcSetup and ledcWrite to do pwm on the pin, connected to the piezzo beeper.
this works fine under arduino framework 1.0.6.
after switching to framework 2, tone generation got instable.
only about every second time, i hear a beep, although the code that should beep is executed every time.
when going back to 1.0.6, this works without any issues.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: