int ledPin = 13;
int potPin = 5;
int value = 0;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
value = analogRead(potPin);
digitalWrite(ledPin, HIGH);
delay(value);
digitalWrite(ledPin, LOW);
delay(value);
}
电位器控制LED闪烁频率
最新推荐文章于 2023-04-18 21:46:35 发布