#define pot 35
#define l1 32
#define l2 33
#define l3 25
#define l4 26
#define l5 27
#define l6 14
int potvalue = 0;
const int freq = 5000;
const int ledChannel = 0;
const int resolution = 10;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
ledcSetup(ledChannel, freq, resolution);
ledcAttachPin(l1, ledChannel);
ledcAttachPin(l2, ledChannel);
ledcAttachPin(l3, ledChannel);
ledcAttachPin(l4, ledChannel);
ledcAttachPin(l5, ledChannel);
ledcAttachPin(l6, ledChannel);
}
void loop() {
potvalue=analogRead(pot);
ledcWrite(ledChannel, potvalue*1023/4095);
delay(10); // this speeds up the simulation
}