2018年1月30日 星期二

NodeMCU Lesson 2—Hello World!

After completed above oprations, try to upload the first sketch to the NodeMCU.

Preparation

Code:

Connect your NodeMCU to the PC and put below code to your Arduino IDE .
void setup()
{
Serial.begin(115200);//Set the baudrate to 115200,same as the software settings
}
void loop()
{
Serial.println("Hello World!");//Print character string“Hello World!”on the serial
delay(5000);// Delay 5 second
}

Choose corresponding board/port for your project,upload the sketch to the board.
boardsettings
After upload down,click Serial Monitor button,you will see the running result as below:
serial monitor
serial monitor result
You will see the serial monitor output every 5 second.
Note: Make sure the baudrate is same as your sketch setting.


static const uint8_t D0   = 16;
static const uint8_t D1   = 5;
static const uint8_t D2   = 4;
static const uint8_t D3   = 0;
static const uint8_t D4   = 2;
static const uint8_t D5   = 14;
static const uint8_t D6   = 12;
static const uint8_t D7   = 13;
static const uint8_t D8   = 15;
static const uint8_t D9   = 3;
static const uint8_t D10  = 1;


沒有留言:

張貼留言

MQTT 協定與 Modbus 通訊的遠端監控與控制系統架構

MQTT 協定與 Modbus 通訊的遠端監控與控制系統架構 這張圖片展示了一個 結合 MQTT 協定與 Modbus 通訊的遠端監控與控制系統架構 (主要透過 Node-RED 進行資料整合)。 系統包含三個核心部分,其運作功能說明如下: 1. ESP32 終端設備(硬體控制層...