码迷,mamicode.com
首页 > 其他好文 > 详细

arduino 用电位器调节LED闪烁频率

时间:2015-08-08 11:50:06      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

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

arduino 用电位器调节LED闪烁频率

标签:

原文地址:http://www.cnblogs.com/lnooge/p/4712687.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!