2019-03-17 23:54:43 +00:00
|
|
|
const char* host = "ESP-OTA"; // Used for MDNS resolution
|
2019-03-14 04:29:53 +00:00
|
|
|
const char* ssid = "ssid";
|
|
|
|
const char* password = "password";
|
|
|
|
|
|
|
|
#include <WebOTA.h>
|
|
|
|
|
|
|
|
#define LED_PIN 2
|
|
|
|
|
|
|
|
// the setup function runs once when you press reset or power the board
|
|
|
|
void setup() {
|
|
|
|
Serial.begin(115200);
|
|
|
|
|
|
|
|
// initialize digital pin LED_PIN as an output.
|
|
|
|
pinMode(LED_PIN, OUTPUT);
|
|
|
|
|
|
|
|
init_wifi(ssid, password, host);
|
2019-03-16 05:22:08 +00:00
|
|
|
|
|
|
|
// Defaults to 8080 and "/webota"
|
2019-03-19 21:33:57 +00:00
|
|
|
//webota.init(80, "/update");
|
2019-03-14 04:29:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// the loop function runs over and over again forever
|
|
|
|
void loop() {
|
2019-03-14 22:27:24 +00:00
|
|
|
int md = 1000;
|
2019-03-14 04:29:53 +00:00
|
|
|
|
|
|
|
digitalWrite(LED_PIN, HIGH);
|
2019-03-19 21:33:57 +00:00
|
|
|
webota.delay(md);
|
2019-03-14 04:29:53 +00:00
|
|
|
digitalWrite(LED_PIN, LOW);
|
2019-03-19 21:33:57 +00:00
|
|
|
webota.delay(md);
|
2019-03-14 04:29:53 +00:00
|
|
|
|
2019-03-19 21:33:57 +00:00
|
|
|
webota.handle();
|
2019-03-14 04:29:53 +00:00
|
|
|
}
|