Hello,
I am working on a project and I need to fade leds with a potentiometer.
I am using an arduino nano, I read an analog input and use output PWM to control the led circuit. My first issue is my board is making audible noise due to resonance in the circuit.
I manage to get rid of the noise by increasing the PWM frequency, but when I set frequency to 32KHZ (no audible noise at all), my analog read is not smooth at all. It is like 0 or 1 and I get full brightness or no brightness at all.
Everything is working @4khz by using TCCR2B = TCCR2B & 0b11111000 | 0x02; but I still get some audible noise so I would like to use 32khz .
Any thought please ?