qq_57450155 2021-09-17 22:43 采纳率: 0%
浏览 74

arduino温湿度蓝牙输出代码报错

家人们,请问是哪里有错呢

img

总报错:In file included from D:\360MoveData\Users\娴埜鐖竆Desktop\sketch_sep14a\sketch_sep14a.ino:2:0:

D:\Program Files\e5ad98e6a1a3e4bfaee5a48d\Arduino\libraries\DHT_sensor_library/DHT.h:44:15: error: expected unqualified-id before numeric constant

#define DHT11 11 /**< DHT TYPE 11 */

           ^

D:\360MoveData\Users\娴埜鐖竆Desktop\sketch_sep14a\sketch_sep14a.ino:7:7: note: in expansion of macro 'DHT11'

D:\Program Files\e5ad98e6a1a3e4bfaee5a48d\Arduino\libraries\DHT_sensor_library/DHT.h:44:15: error: expected unqualified-id before numeric constant

#define DHT11 11 /**< DHT TYPE 11 */

           ^

D:\360MoveData\Users\娴埜鐖竆Desktop\sketch_sep14a\sketch_sep14a.ino:19:1: note: in expansion of macro 'DHT11'

D:\360MoveData\Users\娴埜鐖竆Desktop\sketch_sep14a\sketch_sep14a.ino: In function 'void loop()':

sketch_sep14a:23: error: request for member 'read' in '11', which is of non-class type 'int'

sketch_sep14a:24: error: request for member 'temperature' in '11', which is of non-class type 'int'

sketch_sep14a:26: error: request for member 'humidity' in '11', which is of non-class type 'int'

In file included from D:\360MoveData\Users\娴埜鐖竆Desktop\sketch_sep14a\sketch_sep14a.ino:2:0:

D:\Program Files\e5ad98e6a1a3e4bfaee5a48d\Arduino\libraries\DHT_sensor_library/DHT.h:44:15: error: expected unqualified-id before numeric constant

#define DHT11 11 /**< DHT TYPE 11 */

           ^

D:\360MoveData\Users\娴埜鐖竆Desktop\sketch_sep14a\serial.ino:2:7: note: in expansion of macro 'DHT11'

serial:4: error: a function-definition is not allowed here before '{' token

serial:8: error: a function-definition is not allowed here before '{' token

serial:18: error: expected '}' at end of input

exit status 1
request for member 'read' in '11', which is of non-class type 'int'

  • 写回答

1条回答 默认 最新

  • jianqiang.xue 嵌入式领域优质创作者 2021-09-18 13:56
    关注

    img


    多了一个括号

    评论

报告相同问题?

问题事件

  • 创建了问题 9月17日

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程