小度,小爱编译时报错 'BlinkerMIOT' was not declared in this scope-Arduino中文社区 - Powered by Discuz! Archiver

HLT253 发表于 2022-4-2 00:05

小度,小爱编译时报错 'BlinkerMIOT' was not declared in this scope

准备添加小度,小爱语音控制,结果按照教程码的程序,一直不通过,报错如下:   是因为库没更新,或不完整导致的吗?有没有遇到类似情况的。


D:\Documents\Arduino\blinker\blinker.ino: In function 'void miotPowerState(const String&)':
blinker:43:5: error: 'BlinkerMIOT' was not declared in this scope
   BlinkerMIOT.powerState("on");
   ^
blinker:49:5: error: 'BlinkerMIOT' was not declared in this scope
   BlinkerMIOT.powerState("off");
   ^
D:\Documents\Arduino\blinker\blinker.ino: In function 'void setup()':
blinker:229:5: error: 'BlinkerMIOT' was not declared in this scope
   BlinkerMIOT.attachPowerState(miotPowerState); //小爱语音操作注册函数
   ^
exit status 1
'BlinkerMIOT' was not declared in this scope



奈何col 发表于 2022-4-2 00:46

需要添加宏定义 #define BLINKER_MIOT_LIGHT
请先阅读文档和例程,再做开发
https://diandeng.tech/doc/xiaoai

HLT253 发表于 2022-4-2 23:37

之前都是在玩51,刚刚接触8266所以还有很多规则不太熟悉,原来#define 和include还有先后顺序区分。

coloz 发表于 2022-4-3 18:16

HLT253 发表于 2022-4-2 23:37
之前都是在玩51,刚刚接触8266所以还有很多规则不太熟悉,原来#define 和include还有先后顺序区分。 ...

这和芯片无关,可以了解下C语言相关预编译语法
页: [1]
查看完整版本: 小度,小爱编译时报错 'BlinkerMIOT' was not declared in this scope