乐联网多路控制继电器所用库的兼用性
我正在做一个智能温室的模型,功能包括通过自动控制浇水、通风、检测土壤温湿度、检测空气温湿度、本地用nokia5110显示参数、网络端远程显示土壤和空气温湿度、网络端远程控制空气通风和浇水~~~~~~~~~~(好了,不要意淫了,我还没做完呢)我在http://www.lewei50.com/dev/doc/169学习远程控制一个继电器,用的库也是那个教程里的(懒人点这https://github.com/lewei50/LeweiTcpClient/tree/LeweiTcpClientliteBeta/examples),并效仿出分别控制2个继电器的方法,效果很好,控制的速度很快,基本是手机一点开关,继电器就开(4M的网线
同时控制两个继电器,relay和relay2已经连接上了
程序在此(里面有这次所用的库)
因为这个库比较老,没有上传DHT11等传感器的功能,只好换一个新版的。换了新版的LeweiTcpClient库(新版库在此)之后,原来控制两个继电器的程序就写不进去了,题主本着独立的精神,一个人琢磨,然后把新版库里面的tutorial2_ekit_remote_control_led_in_one_command改成这样(程序),就出现了下面的情况
一直联不上
麻烦各位高人看看哪里出现了问题、又或者在新版的库里面怎么改才能用控制器控制。
使用正确的库文件即可控制
https://github.com/lewei50/LeweiTcpClient/tree/LeweiTcpClientliteBeta
把它解压缩到你的arduino安装路径,库文件夹,类似于d:arduinolibraries
加入上传功能,请自己把库目录下LeweiTcpClient.h和LeweiTcpClient.cpp里面,上传代码部分解除注释即可使用上传功能。// void appendSensorValue(String sensorName,String sensorValue);
// void appendSensorValue(String sensorName,int sensorValue);
// void appendSensorValue(String sensorName,float sensorValue);
// void appendSensorValue(String sensorName,double sensorValue);
// void appendSensorValue(String sensorName,long sensorValue);
// void sendSensorValue(String sensorName,String sensorValue);
// void sendSensorValue(String sensorName,int sensorValue);
// void sendSensorValue(String sensorName,float sensorValue);
// void sendSensorValue(String sensorName,double sensorValue);
// void sendSensorValue(String sensorName,long sensorValue);arduino uno的可用空间小,能省则省。 瘦网虫 发表于 2015-5-19 15:23 static/image/common/back.gif
使用正确的库文件即可控制
https://github.com/lewei50/LeweiTcpClient/tree/LeweiTcpClientliteBeta
谢谢瘦网虫,但是改了之后出现这个,一直编译出错
C:\Program Files (x86)\arduino-1.7.2/DHT11Find.ino:50: undefined reference to `LeweiTcpClient::appendSensorValue(String, float)'
C:\Program Files (x86)\arduino-1.7.2/DHT11Find.ino:51: undefined reference to `LeweiTcpClient::appendSensorValue(String, float)'
C:\Program Files (x86)\arduino-1.7.2/DHT11Find.ino:52: undefined reference to `LeweiTcpClient::appendSensorValue(String, float)'
C:\Program Files (x86)\arduino-1.7.2/DHT11Find.ino:53: undefined reference to `LeweiTcpClient::sendSensorValue(String, float)'
collect2.exe: error: ld returned 1 exit status
编译有误。 看这个库文件使用说明LeweiTcpClient
页:
[1]