Add WiFi sketch

This commit is contained in:
coolneng 2019-11-29 20:14:18 +01:00
parent dd9301b14e
commit 5b43ce94b6
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
3 changed files with 33 additions and 0 deletions

Binary file not shown.

Binary file not shown.

33
Week 4/WiFi/WiFi.ino Normal file
View File

@ -0,0 +1,33 @@
#include <ESP8266WiFi.h>
const char* ssid = "FundamentosRedes";
const char* password = "00000005";
void setup() {
Serial.begin(115200);
Serial.println("");
Serial.print("CONECTANDO A SSID:");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print("Conectado. Dirección IP: ");
Serial.println(WiFi.localIP());
}
void loop() {
if( WiFi.status() == WL_CONNECTED){
Serial.println("");
Serial.print("Conectado. Dirección IP: ");
Serial.println(WiFi.localIP());
}
else{
Serial.println("");
Serial.println("WiFi no conectada");
}
delay(1000);
}