From f12d265653719924d59c774312ff506dc16ea261 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Thu, 9 May 2013 11:14:59 +0200 Subject: Bridge lib moved bridge branch embedded into ide discovery branch --- .../Bridge/examples/HttpClient/HttpClient.ino | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 libraries/Bridge/examples/HttpClient/HttpClient.ino (limited to 'libraries/Bridge/examples/HttpClient') 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 + +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); +} + + -- cgit v1.2.3-18-g5258