const int sliderPin = 34; // 连接滑动变阻器的GPIO引脚
const int ledPin = 25; // 连接LED的GPIO引脚
void setup() {
pinMode(sliderPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
int sliderValue = analogRead(sliderPin);
int brightness = map(sliderValue, 0, 4095, 0, 255);
analogWrite(ledPin, brightness);
}