Hi why not working tone in esp32 ?
sample :
tone(SOUND_PIN, 1000, 1000);
delay(1000);
noTone(SOUND_PIN)
esp32 tone
Re: esp32 tone
You can use:
Remember to first setup pwm:
See:
https://github.com/espressif/arduino-es ... hal-ledc.h
Example:
https://github.com/espressif/arduino-es ... reFade.ino
More clear example:
https://techtutorialsx.com/2017/07/01/e ... -with-pwm/
Code: Select all
ledcWriteTone(uint8_t channel, double freq);
Code: Select all
ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);
https://github.com/espressif/arduino-es ... hal-ledc.h
Example:
https://github.com/espressif/arduino-es ... reFade.ino
More clear example:
https://techtutorialsx.com/2017/07/01/e ... -with-pwm/
Who is online
Users browsing this forum: Google [Bot] and 74 guests