aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge/examples/HttpClient
diff options
context:
space:
mode:
authorFederico Fissore <f.fissore@arduino.cc>2013-07-05 15:06:37 +0200
committerFederico Fissore <f.fissore@arduino.cc>2013-07-05 15:06:37 +0200
commitd11a723abb95002981fc7ca620fab4f7ce4bb158 (patch)
tree0aa718443c7b6e5bb11b6746f36e4424a65859e2 /libraries/Bridge/examples/HttpClient
parent26010e7eacbff52ea36b786343c50fde6fcfb965 (diff)
delete OLDYahooWeather example
Updated pretty-wifi-info-lua path in ShellCommands and WifiStatus examples Tried to make a sense of HttpClient example by making it fetch http://arduino.cc/asciilogo.txt
Diffstat (limited to 'libraries/Bridge/examples/HttpClient')
-rw-r--r--libraries/Bridge/examples/HttpClient/HttpClient.ino14
1 files changed, 8 insertions, 6 deletions
diff --git a/libraries/Bridge/examples/HttpClient/HttpClient.ino b/libraries/Bridge/examples/HttpClient/HttpClient.ino
index bf5e8ff..5696bf0 100644
--- a/libraries/Bridge/examples/HttpClient/HttpClient.ino
+++ b/libraries/Bridge/examples/HttpClient/HttpClient.ino
@@ -5,17 +5,19 @@ void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
+ Serial.begin(9600);
+ while(!Serial);
}
void loop() {
HttpClient client;
- client.get("http://my.server.address/file.php");
+ client.get("http://arduino.cc/asciilogo.txt");
- char c = client.read();
- if (c=='1')
- digitalWrite(13, HIGH);
- if (c=='0')
- digitalWrite(13, LOW);
+ while (client.available()) {
+ char c = client.read();
+ Serial.print(c);
+ }
+ Serial.flush();
delay(5000);
}