diff options
author | Federico Fissore <f.fissore@arduino.cc> | 2013-05-09 11:14:59 +0200 |
---|---|---|
committer | Federico Fissore <f.fissore@arduino.cc> | 2013-05-09 11:15:36 +0200 |
commit | f12d265653719924d59c774312ff506dc16ea261 (patch) | |
tree | e6f099dcd4ad103177cab601daa5d7319450ba84 /libraries/Bridge/examples/HttpClient | |
parent | 48eb4551dcde6eb40574d1d7cb41075c09339ccc (diff) |
Bridge lib moved bridge branch embedded into ide discovery branch
Diffstat (limited to 'libraries/Bridge/examples/HttpClient')
-rw-r--r-- | libraries/Bridge/examples/HttpClient/HttpClient.ino | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libraries/Bridge/examples/HttpClient/HttpClient.ino b/libraries/Bridge/examples/HttpClient/HttpClient.ino new file mode 100644 index 0000000..bf5e8ff --- /dev/null +++ b/libraries/Bridge/examples/HttpClient/HttpClient.ino @@ -0,0 +1,23 @@ + +#include <HttpClient.h> + +void setup() { + pinMode(13, OUTPUT); + digitalWrite(13, LOW); + Bridge.begin(); +} + +void loop() { + HttpClient client; + client.get("http://my.server.address/file.php"); + + char c = client.read(); + if (c=='1') + digitalWrite(13, HIGH); + if (c=='0') + digitalWrite(13, LOW); + + delay(5000); +} + + |