const int ledPin = 15; // 16 corresponds to GPIO16
const int freq = 9000;
const int ledChannel = 0;
const int resolution = 10;
void setup(){
Serial.begin(9600);
ledcSetup(ledChannel, freq, resolution);
ledcAttachPin(ledPin, ledChannel);
}
void loop(){
int dutyCycle = analogRead(A0);
ledcWrite(ledChannel, dutyCycle);
delay(15);
}