# Adding NodeMCU support to Arduino IDE

This guide will help you program the **NodeMCU** using the **Arduino IDE**.

### Step 1: Connect Your NodeMCU to Your Computer

You need a **USB micro B cable** to connect the NodeMCU board to your computer. Once connected, a **blue LED** will start flashing.

If your computer does not detect the NodeMCU board, you may need to download the appropriate driver from the following link:

* [USB to UART Bridge VCP Drivers](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)

### Step 2: Open Arduino IDE

Ensure you have **Arduino IDE version 1.6.4** or later to proceed.

1. Go to **File > Preferences**.
2. In the **"Additional Boards Manager URLs"** field, type (or copy-paste) the following URL:

   ```
   http://arduino.esp8266.com/stable/package_esp8266com_index.json
   ```
3. Click **OK**.
4. Now, go to **Tools > Board > Board Manager**.
5. In the search field, type **"esp8266"**.
6. You should see an entry named **"esp8266 by ESP8266 Community"**. Click on it and press the **Install** button on the lower right.

Once the download is complete, you're ready to start coding!

### Step 3: Make an LED Blink Using NodeMCU

For our first program, we will blink an LED connected to one of the digital pins of the NodeMCU board. **Note**: The pin names printed on the board may differ from the pin names used in the program.

In this example, we'll connect the LED to **D7**, which corresponds to **GPIO13**. Below is the code (which is a modified version of the Arduino **Blink** example):

```cpp
// The setup function runs once when you press reset or power the board
void setup() {
  // Initialize digital pin 13 (D7) as an output.
  pinMode(13, OUTPUT);
}

// The loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // Turn the LED on (HIGH is the voltage level)
  delay(1000);              // Wait for one second
  digitalWrite(13, LOW);    // Turn the LED off by making the voltage LOW
  delay(1000);              // Wait for one second
}
```

#### NodeMCU Pin Mapping

* In this example, **D7** (as printed on the board) corresponds to **GPIO13** in the code.

Ensure that the LED is connected to the correct pin as per the board's pinout.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.consentiumiot.com/board-support/adding-nodemcu-support-to-arduino-ide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
