The most up-to-date information on how to use the Arduino IDE for ESP is at:
Once you've setup ESP via board manager, choose it from the board menu:
Once you've chosen the correct ESP board, Arduino IDE will show ESP specific examples!
This blink will blink the built-in LED on the ESP.
If you wired up your ESP like diagrammed below, modify the IO pins in Blink (three places) from LED_BUILT_IN to 2.
The resistor values are as follows:
- LED current limiting resistor = 1K
- Pushbutton switch pullup resistor = 1K
- Voltage divider resistors = 1K (top), 1.8K (bottom)
You can connect FTDI TX to ESP RX directly if you have a 3.3V FTDI.
Compile and upload the sketch by pressing Control-U or clicking the Upload button.
If there are no compile errors, the IDE will display Uploading... and wait for you to put the ESP in bootloader mode.
To do that:
- Turn off the ESP.
- Bring GPIO0 to ground (if you use the above circuit, press AND HOLD DOWN the pushbutton).
- Turn on the ESP.
- You can release the pushbutton as soon as Arduino IDE starts uploading.
The ESP will automatically run the sketch as soon as the upload is completed.
This is exciting!
This Arduino IDE completely replaces the firmware on the ESP each time you upload, so if you want to use the ESP with NodeMCU or AT commands, you will need to reflash the ESP with the desired firmware.