问题
I know when we buy a NodeMCU, we get the NodeMCU firmware already installed in it. But how come we are able to use the Arduino IDE (used for C++ programming) with this dev kit?
How can we use a C++ IDE to work with a Lua-based firmware? What's wrong with my concepts here?
回答1:
"Lua based firmware" is a bit misleading as the core firmware itself is written in C (so is the Lua interpreter btw).
Checkout it's source code https://github.com/nodemcu
The nodeMCU firmware is erased and replaced by your Arduino sketch. You code it like any other Arduino.
You have to flash the NodeMCU firmware if you want to run Lua scripts on it again.
It's just two different pieces of software supporting the same micro controller.
来源:https://stackoverflow.com/questions/47508913/why-does-the-arduino-ide-work-with-nodemcu