There is no way i get this running again .
In the past it fired up the router in my network scan but dissepeared after about 10 minutes.
I have restted it by an new , empty sketch. after that several setches uploaded.
The last time i tried this one , because it was the only ever running.
Pls advice ?
/*
File: WebServerBlink.ino
This example creates a simple web server on your Arduino Uno WiFi. It serves a
simple web page with 2 buttons that can be used to switch on and off on-board led 13.
Please type on your browser http:///arduino/webserver/ or http://.local/arduino/webserver/
Note: works only with Arduino Uno WiFi Developer Edition.
*/
#include <Wire.h>
#include <UnoWiFiDevEd.h>
void setup() {
pinMode(13,OUTPUT);
Wifi.begin();
Wifi.println("Web Server is up");
}
void loop() {
while(Wifi.available()){
process(Wifi);
}
delay(500);
}
void process(WifiData client) {
// read the command
String command = client.readStringUntil('/');
// is "digital" command?
if (command == "webserver") {
WebServer(client);
}
if (command == "digital") {
digitalCommand(client);
}
}
void WebServer(WifiData client) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("");
client.println(" ");
client.print("");
client.print("Click<input type=button onClick="var w=window.open('/arduino/digital/13/1','_parent');w.close();"value='ON'>pin13 ON
");
client.print("Click<input type=button onClick="var w=window.open('/arduino/digital/13/0','_parent');w.close();"value='OFF'>pin13 OFF
");
client.print("");
client.println("");
client.print(DELIMITER); // very important to end the communication !!!
}
void digitalCommand(WifiData client) {
int pin, value = 0;
// Read pin number
pin = client.parseInt();
// If the next character is a '/' it means we have an URL
// with a value like: "/digital/13/1"
if (client.read() == '/') {
value = client.parseInt();
digitalWrite(pin, value);
}
// Send feedback to client
client.println("Status: 200 OK\n");
client.print(F("Pin D"));
client.print(pin);
client.print(F(" set to "));
client.print(value);
client.print(EOL); //char terminator
}
