[Arduino物联网开发实战2]数据反馈-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: 奈何col

[使用文档] [Arduino物联网开发实战2]数据反馈

  [复制链接]
发表于 2019-7-22 05:59 | 显示全部楼层
请问大佬,如果要用的传感器没有库那应该怎么写呢,谢谢大佬

点评

这。。。从何说起。。。先清除驱动原理,再说。。。  详情 回复 发表于 2019-7-22 20:23
 楼主| 发表于 2019-7-22 20:23 | 显示全部楼层
oscarangustin 发表于 2019-7-22 05:59
请问大佬,如果要用的传感器没有库那应该怎么写呢,谢谢大佬

这。。。从何说起。。。先清楚驱动原理,再说。。。
发表于 2019-8-26 06:11 | 显示全部楼层
本帖最后由 lukedog 于 2019-8-26 06:20 编辑

弄了好几天了,不知道什么原因,编译不成功


Arduino:1.8.9 (Windows 7), 开发板:"Generic ESP8266 Module, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), ck, 40 MHz, 40MHz, DOUT (compatible), 512K (no SPIFFS), 2, nonos-sdk 2.2.1 (legacy), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\Administrator\Documents\Arduino\libraries\DHT-sensor-library-master\DHT_U.cpp:15:0:

C:\Users\Administrator\Documents\Arduino\libraries\DHT-sensor-library-master\DHT_U.h:36:29: fatal error: Adafruit_Sensor.h: No such file or directory

#include <Adafruit_Sensor.h>

                             ^

compilation terminated.

exit status 1
为开发板 Generic ESP8266 Module 编译时出错。

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

发表于 2019-8-26 10:51 | 显示全部楼层
编译成功,但是又有新问题 Failed to read from DHT sensor!
发表于 2019-8-26 12:10 | 显示全部楼层
lukedog 发表于 2019-8-26 10:51
编译成功,但是又有新问题 Failed to read from DHT sensor!

没有插好对应的DHT传感器,或者你的传感器坏了
发表于 2019-12-11 17:02 | 显示全部楼层
Arduino:1.8.10 (Windows 10), 开发板:"Arduino Yún"

In file included from D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,

                 from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h:5,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:46,

                 from G:\毕设资料\demo\WiFi\dht11\dht11.ino:3:

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:234:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         char* dataParse()       { if (canParse) return conn->lastRead(); else return ""; }

                                                                                      ^~

In file included from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h:5:0,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:46,

                 from G:\毕设资料\demo\WiFi\dht11\dht11.ino:3:

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:775:97: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);

                                                                                                 ^

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6994:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7008:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7014:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7020:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

In file included from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:46:0,

                 from G:\毕设资料\demo\WiFi\dht11\dht11.ino:3:

D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h: At global scope:

D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h:147:27: error: cannot declare field 'BlinkerSerialESPMQTT::Transp' to be of abstract type 'BlinkerSerialMQTT'

         BlinkerSerialMQTT Transp;

                           ^~~~~~

In file included from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h:4:0,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:46,

                 from G:\毕设资料\demo\WiFi\dht11\dht11.ino:3:

D:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerSerialMQTT.h:26:7: note:   because the following virtual functions are pure within 'BlinkerSerialMQTT':

class BlinkerSerialMQTT : public BlinkerStream

       ^~~~~~~~~~~~~~~~~

In file included from D:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerSerialMQTT.h:13:0,

                 from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h:4,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:46,

                 from G:\毕设资料\demo\WiFi\dht11\dht11.ino:3:

d:\arduino\libraries\blinker-library-master\src\blinker\blinkerstream.h:42:29: note:         virtual int BlinkerStream::duerPrint(const String&, bool)

                 virtual int duerPrint(const String & data, bool report = false) = 0;

                             ^~~~~~~~~

G:\毕设资料\demo\WiFi\dht11\dht11.ino:10:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

G:\毕设资料\demo\WiFi\dht11\dht11.ino:11:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

dht11:14:17: error: 'D7' was not declared in this scope

G:\毕设资料\demo\WiFi\dht11\dht11.ino:19:9: note: in expansion of macro 'DHTPIN'

G:\毕设资料\demo\WiFi\dht11\dht11.ino:14:17: note: suggested alternative: 'A7'

G:\毕设资料\demo\WiFi\dht11\dht11.ino:19:9: note: in expansion of macro 'DHTPIN'

"SoftwareSerial.h" 对应多个库
已使用: D:\Arduino\hardware\arduino\avr\libraries\SoftwareSerial
"DHT.h" 对应多个库
已使用: D:\Arduino\libraries\DHT-sensor-library-master
"Blinker.h" 对应多个库
已使用: D:\Arduino\libraries\blinker-library-master
exit status 1
'D7' was not declared in this scope

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。
这是怎么回事?

点评

你选的板子是arduino yun,但实际上并不是吧。  详情 回复 发表于 2019-12-12 01:08
 楼主| 发表于 2019-12-12 01:08 | 显示全部楼层
stephan 发表于 2019-12-11 17:02
Arduino:1.8.10 (Windows 10), 开发板:"Arduino Yún"

In file included from D:\Arduino\libraries\blin ...

你选的板子是arduino yun,但实际上并不是吧。
发表于 2019-12-13 09:04 | 显示全部楼层
奈何col 发表于 2019-12-12 01:08
你选的板子是arduino yun,但实际上并不是吧。

是的,选错了,已解决,谢谢
发表于 2020-2-18 20:40 | 显示全部楼层
BLINKER_LOG("Humidity: ", h, " %");
        BLINKER_LOG("Temperature: ", t, " *C");
是干嘛的啊

点评

文档有搜索功能  详情 回复 发表于 2020-2-18 23:40
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 01:47 , Processed in 0.113286 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表