arduino esp8266 install code example

Example 1: install nodemcu in arduino

Go to file -> preferances. 	
Add below link to additional board manager. 
LINK: http://arduino.esp8266.com/stable/package_esp8266com_index.json
Tools -> Boards Manager 
Search for ESP and install esp8266

Example 2: esp8266 arduino

#include <ESP8266WiFi.h>

void setup()
{
  Serial.begin(115200);
  Serial.println();

  WiFi.begin("network-name", "pass-to-network");

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {}

Example 3: esp8266 arduino

WiFi.printDiag(Serial);

Example 4: esp8266 arduino

WiFi.begin("network-name", "pass-to-network");