关于arduino和yeelink的程序问题?再问
看过yeelink有关程序,多个传感器采集数据时,最后一行是
// This method calculates the number of digits in the
// sensor reading.Since each digit of the ASCII decimal
// representation is a byte, the number of digits equals
// the number of bytes:
int getLength(int someValue) {
// there's at least one byte:
int digits = 1;
// continually divide the value by ten,
// adding one to the digit count for each
// time you divide, until you're at 0:
int dividend = someValue /10;
while (dividend > 0) {
dividend = dividend /10;
digits++;
}
// return the number of digits:
return digits;
}
对于这个注释,理解不是很明白,digits = 1跟传感器数量有关系吗?如果是四个传感器,是不是digits为4呢,我要实现四个传感器采集的数据上传至yeelink用户中心,请大家解答一下,我想听听你们的看法 这段程序作用是将传感器读到的数值转化成字符,同时计算出几位数。和传感器数量无关。每个传感器送出的数值都要在这里转换,因为yeelink接收字符串 林定祥 发表于 2015-4-9 19:12 static/image/common/back.gif
这段程序作用是将传感器读到的数值转化成字符,同时计算出几位数。和传感器数量无关。每个传感器送出的数值 ...
谢谢指点 楼主已经实现将数据上传到yeelink了吗?我也在做这个,能否分享一下经验
hgmyaoming 发表于 2015-4-10 11:52 static/image/common/back.gif
楼主已经实现将数据上传到yeelink了吗?我也在做这个,能否分享一下经验
你是做什么?我现在是将多个传感器数据上传遇到点问题 请问楼主是上传哪些传感器的数据,我在上传PPD42NS数据时遇到了问题,能否帮忙指点下,我的帖子链接是http://www.geek-workshop.com/thread-14580-1-1.html
页:
[1]