Created
February 12, 2020 05:08
-
-
Save parzibyte/b08304c76d8c0a9cd3898d51cd59213b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() | |
{ | |
// Configuración del LED | |
pinMode(LED_D1, OUTPUT); | |
// Configurar como un access point | |
WiFi.softAP(NOMBRE_RED, CLAVE_RED); | |
WiFi.softAPConfig(ip, puertaDeEnlace, mascaraDeRed); | |
delay(100); | |
// Configuramos la ruta y la función que responderá a la solicitud de dicha ruta | |
servidor.on("/", rutaRaiz); | |
servidor.on("/encender", rutaEncenderLed); | |
servidor.on("/apagar", rutaApagarLed); | |
servidor.onNotFound(rutaNoEncontrada); | |
// Empezar a escuchar | |
servidor.begin(); | |
} | |
// En el loop manejamos al cliente conectado y eso es todo ;) | |
void loop() | |
{ | |
servidor.handleClient(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment