Книга: ESP8266: Programming NodeMCU Using Arduino IDE - Get Started With ESP8266 (Internet Of Things, IOT, Projects In Internet Of Things, Internet Of Things for Beginners, NodeMCU Programming, ESP8266)
Назад: Chapter 9: Step-by-Step Guide To Programming NodeMCU
Дальше: Chapter 11: Creating Your 2nd Project


 

Creating Your 1st Project

LED blinking on NodeMCU

 

Lets first begin with a small program like our all time favorite LED blinking.

 

In this project we will turn on and turn off on board LED. This project will give you confirmation of basic working functionality of your module Like UART and LED.

 

Step 1 Open Arduino IDE.

Step 2 Copy the following program

 

/* 

NodeMCU example: Led blinking

*/

int LEDPin = 16;

void setup() {

              pinMode(LEDPin, OUTPUT);

  }

void loop() {

              digitalWrite(LEDPin, HIGH); delay(500);

              digitalWrite(LEDPin, LOW); delay(500);

  }

 

 

Назад: Chapter 9: Step-by-Step Guide To Programming NodeMCU
Дальше: Chapter 11: Creating Your 2nd Project