Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译 验证就报错 #1

Open
TomYule opened this issue Apr 25, 2021 · 2 comments
Open

编译 验证就报错 #1

TomYule opened this issue Apr 25, 2021 · 2 comments

Comments

@TomYule
Copy link

TomYule commented Apr 25, 2021

编译 验证就报错
#define PIN_LIGHT1 D4
#define PIN_DATA1 A0
#define PIN_LIGHT2 D3
#define PIN_LIGHT3 D2
#define PIN_LIGHT4 D1

Arduino:1.8.14 Hourly Build 2021/03/09 09:34 (Mac OS X), 开发板:"Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"











/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino: In function 'void pin()':
HelloServer:11:20: error: 'D4' was not declared in this scope
 #define PIN_LIGHT1 D4
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:33:18: note: in expansion of macro 'PIN_LIGHT1'
       controller(PIN_LIGHT1);break;
                  ^
HelloServer:13:20: error: 'D3' was not declared in this scope
 #define PIN_LIGHT2 D3
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:35:18: note: in expansion of macro 'PIN_LIGHT2'
       controller(PIN_LIGHT2);break;
                  ^
HelloServer:14:20: error: 'D2' was not declared in this scope
 #define PIN_LIGHT3 D2
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:37:18: note: in expansion of macro 'PIN_LIGHT3'
       controller(PIN_LIGHT3);break;
                  ^
HelloServer:15:20: error: 'D1' was not declared in this scope
 #define PIN_LIGHT4 D1
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:39:18: note: in expansion of macro 'PIN_LIGHT4'
       controller(PIN_LIGHT4);break;
                  ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino: In function 'void setup()':
HelloServer:11:20: error: 'D4' was not declared in this scope
 #define PIN_LIGHT1 D4
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:111:11: note: in expansion of macro 'PIN_LIGHT1'
   pinMode(PIN_LIGHT1, OUTPUT);
           ^
HelloServer:13:20: error: 'D3' was not declared in this scope
 #define PIN_LIGHT2 D3
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:112:11: note: in expansion of macro 'PIN_LIGHT2'
   pinMode(PIN_LIGHT2, OUTPUT);
           ^
HelloServer:14:20: error: 'D2' was not declared in this scope
 #define PIN_LIGHT3 D2
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:113:11: note: in expansion of macro 'PIN_LIGHT3'
   pinMode(PIN_LIGHT3, OUTPUT);
           ^
HelloServer:15:20: error: 'D1' was not declared in this scope
 #define PIN_LIGHT4 D1
                    ^
/Users/wander/Documents/Arduino/ESP8266WebServer-master/HelloServer/HelloServer.ino:114:11: note: in expansion of macro 'PIN_LIGHT4'
   pinMode(PIN_LIGHT4, OUTPUT);
           ^
exit status 1
'D4' was not declared in this scope


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

@ThinkCodeStudio
Copy link
Owner

这里的是对硬件IO口的宏定义,要对应硬件修改。
然后这个项目我用是没有问题的,你没有给我报错信息,我无法准确定位问题。

@TomYule
Copy link
Author

TomYule commented Apr 27, 2021

重新更新了错误信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants