Skip to content

Commit 3e2008d

Browse files
author
Federico Fissore
committed
updated Bridge examples headers
1 parent 421fa18 commit 3e2008d

File tree

14 files changed

+80
-31
lines changed

14 files changed

+80
-31
lines changed

libraries/Bridge/examples/Bridge/Bridge.ino

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
/*
2-
Bridge
2+
Arduino Yun Bridge example
33
4-
This example shows how to use the Bridge library to access the digital
5-
and analog pins on the board through REST calls.
6-
It demonstrates how you can create your own API when using REST style
4+
This example for the Arduino Yun shows how to use the
5+
Bridge library to access the digital and analog pins
6+
on the board through REST calls. It demonstrates how
7+
you can create your own API when using REST style
78
calls through the browser.
89
9-
Example of possible commands are listed here:
10-
11-
"/arduino/digital/13" -> digitalRead(13)
12-
"/arduino/digital/13/1" -> digitalWrite(13, HIGH)
13-
"/arduino/analog/2/123" -> analogWrite(2, 123)
14-
"/arduino/analog/2" -> analogRead(2)
15-
"/arduino/mode/13/input" -> pinMode(13, INPUT)
16-
"/arduino/mode/13/output" -> pinMode(13, OUTPUT)
17-
18-
The circuit:
19-
there is no need of a particular circuit, you can connect:
20-
* some analog sensors to the analog inputs
21-
* LEDs to digital or analog outputs
22-
* digital sensors such as buttos to the digital inputs
10+
Possible commands created in this shetch:
11+
12+
* "digital/13" -> digitalRead(13)
13+
* "digital/13/1" -> digitalWrite(13, HIGH)
14+
* "analog/2/123" -> analogWrite(2, 123)
15+
* "analog/2" -> analogRead(2)
16+
* "mode/13/input" -> pinMode(13, INPUT)
17+
* "mode/13/output" -> pinMode(13, OUTPUT)
2318
24-
created April 2013
25-
by Cristian Maglie
19+
http://arduino.cc/en/Tutorial/Bridge
2620
27-
This example code is in the public domain.
28-
29-
*/
21+
This example code is part of the public domain
22+
*/
3023

3124
#include <Bridge.h>
3225
#include <YunServer.h>

libraries/Bridge/examples/ConsoleAsciiTable/ConsoleAsciiTable.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
The circuit: No external hardware needed.
1111
1212
created 2006
13-
by Nicholas Zambetti
13+
by Nicholas Zambetti
14+
http://www.zambetti.com
1415
modified 9 Apr 2012
1516
by Tom Igoe
1617
modified 22 May 2013
1718
by Cristian Maglie
1819
1920
This example code is in the public domain.
20-
21-
<http://www.zambetti.com>
21+
22+
http://arduino.cc/en/Tutorial/ConsoleAsciiTable
2223
2324
*/
2425

libraries/Bridge/examples/ConsolePixel/ConsolePixel.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
2424
This example code is in the public domain.
2525
26+
http://arduino.cc/en/Tutorial/ConsolePixel
27+
2628
*/
2729

2830
#include <Console.h>

libraries/Bridge/examples/ConsoleRead/ConsoleRead.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
by Tom Igoe
1717
1818
This example code is in the public domain.
19+
20+
http://arduino.cc/en/Tutorial/ConsoleRead
21+
1922
*/
2023

2124
#include <Console.h>

libraries/Bridge/examples/Datalogger/Datalogger.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
by Tom Igoe
2626
2727
This example code is in the public domain.
28+
29+
http://arduino.cc/en/Tutorial/YunDatalogger
2830
2931
*/
3032

libraries/Bridge/examples/FileWriteScript/FileWriteScript.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
by Cristian Maglie
99
1010
This example code is in the public domain.
11+
12+
http://arduino.cc/en/Tutorial/FileWriteScript
1113
1214
*/
1315

libraries/Bridge/examples/HttpClient/HttpClient.ino

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,47 @@
1+
/*
2+
3+
Yun HTTP Client
4+
5+
This example for the Arduino Yún shows how create a basic
6+
HTTP client that connects to the internet and downloads
7+
content. In this case, you'll connect to the Arduino
8+
website and download a version of the logo as ASCII text.
9+
10+
created by Tom igoe
11+
May 2013
12+
13+
This example code is in the public domain.
14+
15+
http://arduino.cc/en/Tutorial/HttpClient
16+
17+
*/
118

219
#include <Bridge.h>
320
#include <HttpClient.h>
421

522
void setup() {
23+
// Bridge takes about two seconds to start up
24+
// it can be helpful to use the on-board LED
25+
// as an indicator for when it has initialized
626
pinMode(13, OUTPUT);
727
digitalWrite(13, LOW);
828
Bridge.begin();
29+
digitalWrite(13, HIGH);
30+
931
Serial.begin(9600);
10-
while(!Serial);
32+
33+
while(!Serial); // wait for a serial connection
1134
}
1235

1336
void loop() {
37+
// Initialize the client library
1438
HttpClient client;
39+
40+
// Make a HTTP request:
1541
client.get("http://arduino.cc/asciilogo.txt");
1642

43+
// if there are incoming bytes available
44+
// from the server, read them and print them:
1745
while (client.available()) {
1846
char c = client.read();
1947
Serial.print(c);

libraries/Bridge/examples/Process/Process.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
by Cristian Maglie
99
1010
This example code is in the public domain.
11+
12+
http://arduino.cc/en/Tutorial/Process
1113
1214
*/
1315

libraries/Bridge/examples/ShellCommands/ShellCommands.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
1818
This example code is in the public domain.
1919
20+
http://arduino.cc/en/Tutorial/ShellCommands
21+
2022
*/
2123

2224
#include <Process.h>

libraries/Bridge/examples/TemperatureWebPanel/TemperatureWebPanel.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727
created 6 July 2013
2828
by Tom Igoe
2929
30-
3130
This example code is in the public domain.
32-
31+
32+
http://arduino.cc/en/Tutorial/TemperatureWebPanel
33+
3334
*/
35+
3436
#include <Bridge.h>
3537
#include <YunServer.h>
3638
#include <YunClient.h>

libraries/Bridge/examples/TimeCheck/TimeCheck.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
By Tom Igoe
1212
1313
This example code is in the public domain.
14+
15+
http://arduino.cc/en/Tutorial/TimeCheck
1416
1517
*/
1618

libraries/Bridge/examples/WiFiStatus/WiFiStatus.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
By Federico Fissore
1515
1616
This example code is in the public domain.
17-
*/
17+
18+
http://arduino.cc/en/Tutorial/YunWiFiStatus
19+
20+
*/
1821

1922
#include <Process.h>
2023

libraries/Bridge/examples/XivelyClient/XivelyClient.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
created 15 March 2010
88
updated 27 May 2013
99
by Tom Igoe
10+
11+
http://arduino.cc/en/Tutorial/YunXivelyClient
1012
1113
*/
1214

15+
1316
// include all Libraries needed:
1417
#include <Process.h>
1518
#include "passwords.h" // contains my passwords, see below

libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727
modified by Cristian Maglie
2828
2929
This example code is in the public domain.
30+
31+
http://arduino.cc/en/Tutorial/YunSerialTerminal
32+
3033
*/
3134

35+
3236
long lininoBaud = 250000;
3337

3438
void setup() {
@@ -75,4 +79,4 @@ void loop() {
7579
char c = (char)Serial1.read(); // read from Linino
7680
Serial.write(c); // write to USB-serial
7781
}
78-
}
82+
}

0 commit comments

Comments
 (0)