Programming advice
Posted: Wed Jan 27, 2016 4:16 pm
Hi,
I've experimented with a web server response thingamajig and this code works :
I wonder if there is a other way to do this.
I've experimented with a web server response thingamajig and this code works :
Code: Select all
void handleDigitalWrite(){
String message = "OK\n\n";
String portString = server.argName(0);
message += portString;
message += "pin is set to:";
int portnr = portString.toInt();
String stateString = server.arg (0);
message += stateString;
int statenr = stateString.toInt();
digitalWrite(portnr,statenr);
server.send (200, "text/plain", message );
}
I wonder if there is a other way to do this.