-->
Page 1 of 1

Programming advice

PostPosted: Wed Jan 27, 2016 4:16 pm
by Hneve
Hi,
I've experimented with a web server response thingamajig and this code works :
Code: Select allvoid 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.