ESP32 DAC sinusoidal signal

Hello , I'm using ESP32 DEV KIT on arduino , and I want generate sinus signal with 50Hz I can't get it can someone help me please

Your post was MOVED to its current location as it is more suitable.

the DAC, analogWrite(), generates a voltage using pulse width modulation (PWM). it doesn't actually generate samples liek an audio DAC would.

the output can be filtered but will have harmonics depending on the level of filtering

Digital To Analog Converter (DAC) - ESP32 - — ESP-IDF Programming Guide latest documentation (espressif.com)