Hello! I'm trying to use my nano every to control a motor driver for a project im working on. I need to be able to change the pwm frequency of at least 3 pins to something between 50-100hz for my project to function properly. Is there any way to do this? Ive already tried the PWM library to no avail.
Try the ledc functions, here is a small tutorial
https://randomnerdtutorials.com/esp32-pwm-arduino-ide/
NOTE some of the API is changing as of Ver3 of the esp32 boards, details at https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html
One way around the problem is to leave the esp32 boards at 2.0.17
What library did you try?
The NanoEvery with the Atmega4809 has very different hardware timers than the Atmega328 boards.
Have you looked at megaAvr_PWM? It's available through the library manager. There are several different pwm example programs.
That is specific to the ESP32 microcontroller. The Nano Every board uses the ATmega4809 microcontroller, so ESP32-specific information is not relevant:
There is a very good book from Tom Almy called "Far Inside The Arduino: Nano Every Supplement" He covers comprehensibly all the things you can do with it.
You can get the code from his examples here
https://almy.us/arduinoeverybook.html
Better still buy the book.
My bad, forgot that was specific to the esp32.
Hi! Thanks for your response. I tried to use the library documented at: PWM frequency library - Development / Libraries - Arduino Forum but came to the same conclusion as you that it wouldnt worlk for my hardware. Do you know if the alternativeive library that you mentioned works on the nano every? Thanks!
nevermind, just confirmed that it is compatible. Thanks for the help!