Page 1 of 1

esp32 tone

Posted: Mon Jan 08, 2018 5:06 pm
by gemforce
Hi why not working tone in esp32 ?

sample :

tone(SOUND_PIN, 1000, 1000);
delay(1000);
noTone(SOUND_PIN)

Re: esp32 tone

Posted: Tue Jan 09, 2018 10:54 pm
by ESP_Sprite
Move news > Arduino

Re: esp32 tone

Posted: Thu Jan 11, 2018 11:31 am
by Cellie
You can use:

Code: Select all

    ledcWriteTone(uint8_t channel, double freq);
Remember to first setup pwm:

Code: Select all

ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);
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/