EasyManua.ls Logo

Arduino Yun - Page 21

Arduino Yun
22 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Check to make sure the URL is valid
if (client.read() != '/') {
client.println(F("error"));
return;
}
[Get Code]
If it's a valid URL, store the URL as a string. If the mode is an input or output, configure the
pin and report it to client. If the string doesn't match those values, return an error.
String mode = client.readStringUntil('\r');
if (mode == "input") {
pinMode(pin, INPUT);
// Send feedback to client
client.print(F("Pin D"));
client.print(pin);
client.print(F(" configured as INPUT!"));
return;
}
if (mode == "output") {
pinMode(pin, OUTPUT);
// Send feedback to client
client.print(F("Pin D"));
client.print(pin);
client.print(F(" configured as OUTPUT!"));
return;
}
client.print(F("error: invalid mode "));
client.print(mode);
}
[Get Code]
You can find more details on this example on the Bridge Example page.
Connecting to internet services with Temboo

Related product manuals