From 15fd2d1158521c1a4271d4c4a85f221cf5507a16 Mon Sep 17 00:00:00 2001 From: Fede85 Date: Mon, 9 Sep 2013 13:37:40 +0200 Subject: [PATCH] Added the header to the Bridge.ino example Removed Serial.begin(), there are no serial prints in the sketch. --- libraries/Bridge/examples/Bridge/Bridge.ino | 38 +++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/libraries/Bridge/examples/Bridge/Bridge.ino b/libraries/Bridge/examples/Bridge/Bridge.ino index 277982a8f..ea2ab8473 100644 --- a/libraries/Bridge/examples/Bridge/Bridge.ino +++ b/libraries/Bridge/examples/Bridge/Bridge.ino @@ -1,12 +1,32 @@ +/* + Bridge + + This example shows how to use the Bridge library to access the digital + and analog pins on the board through REST calls. + It demonstrates how you can create your own API when using REST style + calls through the browser. + + Example of possible commands are listed here: -// Possible commands are listed here: -// -// "digital/13" -> digitalRead(13) -// "digital/13/1" -> digitalWrite(13, HIGH) -// "analog/2/123" -> analogWrite(2, 123) -// "analog/2" -> analogRead(2) -// "mode/13/input" -> pinMode(13, INPUT) -// "mode/13/output" -> pinMode(13, OUTPUT) + "/arduino/digital/13" -> digitalRead(13) + "/arduino/digital/13/1" -> digitalWrite(13, HIGH) + "/arduino/analog/2/123" -> analogWrite(2, 123) + "/arduino/analog/2" -> analogRead(2) + "/arduino/mode/13/input" -> pinMode(13, INPUT) + "/arduino/mode/13/output" -> pinMode(13, OUTPUT) + + The circuit: + there is no need of a particular circuit, you can connect: + * some analog sensors to the analog inputs + * LEDs to digital or analog outputs + * digital sensors such as buttos to the digital inputs + + created April 2013 + by Cristian Maglie + + This example code is in the public domain. + + */ #include #include @@ -17,8 +37,6 @@ YunServer server; void setup() { - Serial.begin(9600); - // Bridge startup pinMode(13,OUTPUT); digitalWrite(13, LOW);