I used Arduino 1.8.19 version.
And I upgrade today to 2.3.3 version.
After that I tested basic test with nodeMCU(esp8266)
#define LED D5
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, LOW);
delay(1000);
digitalWrite(LED, HIGH);
delay(2000);
}
It is working well In 1.8.19 version.
But in 2.3.3 version has some compile error.
Compilation error: 'D5' was not declared in this scope
I do not understand this message.
How can I define LED port ?
Thanks in advance.
Please refrain from using ========
in your text; that results in the odd formatting of your code above.
While editing your post, please select all code code, click the <CODE/> button and save your post.
This will apply code tags that make it easier to read and easier to copy; the forum software will also display it correctly.
What happens when you use #define LED 5
?
Thanks,
from now on, I will write as you taught me.
#define LED 5
I tried this code also, compile is OK.
There is no compile error.
But it is not working LED.
Also this code,
#define LED A0
When I connect LED port A0, there is no compilation error and the LED does not work.
Is IDE 1.8.19 installed on the same system? If not or if the IDE 1.8.19 installation is a portable installation, compare the versions of the board packages.
PS
You did not follow the instructions to use code tags.
Thanks again. ^^
You're right.
Instead of uninstalling, I installed it in a different directory on the same system.
The two versions of the IDE share the same board package installation; exception would be the portable installation of IDE 1.8.19. So if it worked in IDE 1.x it should work in IDE 2.x.
I've compiled your original sketch for nodeMCU1.0 12E without any errors (IDE 2.3.3, ESP8266 board package 3.1.2).
FQBN: esp8266:esp8266:nodemcuv2
Using board 'nodemcuv2' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2
Using core 'esp8266' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2
...
...
. Variables and constants in RAM (global, static), used 28100 / 80192 bytes (35%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1496 initialized variables
╠══ RODATA 948 constants
╚══ BSS 25656 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 59747 / 65536 bytes (91%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 26979 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 236084 / 1048576 bytes (22%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 236084 code in flash
So I'm not sure what to make of this.
1 Like
Thanks ,
I found what is problem.
I selected board "Generic ESP8266 Module"
It has compile error like
Compilation error: 'D5' was not declared in this scope
But when I select NodeMCU 1.0 (ESP-12E Module), it is OK like you.
There is no compile error.
Thanks for your support.
Cause of you, I can found what is problem.
I also appreciate knowing how to enter the code.
Thanks again.