arduino 用电位器调节LED闪烁频率
int dianwei; int led = 13; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(led,OUTPUT); } void loop() { // put your main code here, to run repeatedly: dianwei = analogRead(A0); Serial.println(dianwei); digitalWrite(led,HIGH); delay(dianwei); digitalWrite(led,LOW); delay(dianwei); }
原文地址:http://jt.satxt.com/arduino/arduino-y-d-w-q-d-j-led-s-s-p-s.html
刚刚创建了个电子技术QQ群:84033409 DIY天生电子欢迎电子极客到来...