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

读取某引脚的模拟量串口返回

时间:2016-11-04 19:43:51      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:.com   int   读取   gre   ogr   void   模拟   ogre   span   

 1 /*********************************
 2 代码功能:读取某引脚的模拟量串口返回
 3 使用函数:
 4     analogRead(引脚号);     //调用10位AD
 5 创作时间:2016*10*08
 6 作者邮箱:jikexianfeng@outlook.com
 7 ********************************/
 8 int analogTnPin = 2;
 9 void setup()
10 {
11     Serial.begin(9600);
12 }
13 void loop()
14 {
15     int sensorValue = analogRead(analogTnPin);
16     Serial.println(sensorValue);
17     delay(100);
18 }

 

读取某引脚的模拟量串口返回

标签:.com   int   读取   gre   ogr   void   模拟   ogre   span   

原文地址:http://www.cnblogs.com/jikexianfeng/p/6031168.html

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