#define LED_PIN 25
#define POT_PIN 34
#define PWM_FREQ 5000
#define PWM_RESOLUTION 8 // 0–255
void setup() {
// ✅ Doğru LEDC başlatma (Core 3.x)
ledcAttach(LED_PIN, PWM_FREQ, PWM_RESOLUTION);
ledcWrite(LED_PIN, 0);
}
void loop() {
int potValue = analogRead(POT_PIN); // 0–4095
int pwmValue = map(potValue, 0, 4095, 0, 255);
ledcWrite(LED_PIN, pwmValue);
delay(10);
}