4

Arduino:Arduino开发NodeMcu的开发环境搭建

 2 years ago
source link: https://www.taholab.com/23435
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

NodeMCU,是一个开源的物联网平台。 它使用Lua脚本语言编程。该平台基于eLua 开源项目,底层使用ESP8266 sdk 0.9.5版本。该平台使用了很多开源项目, 例如 lua-cjson, spiffs. NodeMCU包含了可以运行在 esp8266 Wi-Fi SoC芯片之上的固件,以及基于ESP-12模组的硬件。总结来说,nodemcu本质就是ESP8266+USB转串口芯片,ESP8266是一块可编程的WIFI芯片。

据了解 ,NodeMcu可分为v2版本和v3版本,v2版本的价格比v3版本稍贵一点,并且v2尺寸稍微小一点,具体差别可查阅其他资料。

板子的外观:

第1步,装驱动

需要做的就是下载相应的驱动 。下载地址:cp2102驱动

安装后插入板子,在设备管理器的“端口”处查看识别情况,正确的话应该如下图所示:

第2步,配环境

下载安装最新版Arduino;

依次点击文件|首选项, 然后跳转到如下界面,将下面的附加开发版管理器网址设置为http://arduino.esp8266.com/stable/package_esp8266com_index.json

随后点击按钮“好”即可。再接着点击工具|开发板|开发板管理器,跳转到如下界面:

然后找到如上所示的包, 再点击安装即可,因为我已安装,所以它显示已安装, 如果找不到这个开发包,那就试着检查一下地址有没有弄错,或者 重启Arduino并重新按照上面的步骤添加附加开发版 管理器地址

下载好后就能在开发板里找到板子了。

2021-08-17_102344.png

然后选择正确的端口即可使用。

可以用Blink例子做测试:

Arduino
//如果是nodemcu V3版,需要另外定义LED引脚
//#define LED_BUILTIN 2
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
  // but actually the LED is on; this is because
  // it is active low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)

更多资料:

NodeMcu—Arduino学习-最终实现远程启动台式机_zihao_cui的博客-CSDN博客

NodeMCU篇-(三)用arduino的方式_STAR_LORD-CSDN博客

使用Arduino开发NodeMcu_非生而知之者的博客-CSDN博客


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK