arduino.esp8266.com/stable/package_esp8266com_index.json
CASELLA DI TESTO
#include "ESP8266WiFi.h"
// WiFi parameters
const char* ssid = "yyyyy.xxxx";
const char* password = "xxxxxxxx";
int LedIO = 13; // LED connected to IO pin 13
void setup(void) {
// put your setup code here, to run once:
// Start Serial
Serial.begin(115200);
Serial.print("Serial Begin");
// Connect to WiFi
WiFi.begin(ssid, password);
int i = 0;
while ((WiFi.status() != WL_CONNECTED ) && (i < 50) ) {
delay(1000);
i++;
Serial.print("\nAttempting connection - seconds: ");
Serial.print(i,DEC);
if (i == 49) Serial.print("WiFi connection failed\n");
}
Serial.println("");
Serial.println("WiFi connected");
// Print the IP address
Serial.println(WiFi.localIP());
// configuring LED as output pin
pinMode(LedIO, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("LED blinking\n");
digitalWrite(LedIO, LOW);
delay(2000);
digitalWrite(LedIO, HIGH);
delay(2000);
}