1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

updated Bridge examples headers

This commit is contained in:
Federico Fissore 2013-09-09 20:56:15 +02:00
parent 421fa18c3c
commit 3e2008dfcc
14 changed files with 79 additions and 30 deletions

View File

@ -1,31 +1,24 @@
/*
Bridge
Arduino Yun Bridge example
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
This example for the Arduino Yun 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 created in this shetch:
"/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)
* "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)
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.
http://arduino.cc/en/Tutorial/Bridge
This example code is part of the public domain
*/
#include <Bridge.h>

View File

@ -11,6 +11,7 @@
created 2006
by Nicholas Zambetti
http://www.zambetti.com
modified 9 Apr 2012
by Tom Igoe
modified 22 May 2013
@ -18,7 +19,7 @@
This example code is in the public domain.
<http://www.zambetti.com>
http://arduino.cc/en/Tutorial/ConsoleAsciiTable
*/

View File

@ -23,6 +23,8 @@
This example code is in the public domain.
http://arduino.cc/en/Tutorial/ConsolePixel
*/
#include <Console.h>

View File

@ -16,6 +16,9 @@
by Tom Igoe
This example code is in the public domain.
http://arduino.cc/en/Tutorial/ConsoleRead
*/
#include <Console.h>

View File

@ -26,6 +26,8 @@
This example code is in the public domain.
http://arduino.cc/en/Tutorial/YunDatalogger
*/
#include <FileIO.h>

View File

@ -9,6 +9,8 @@
This example code is in the public domain.
http://arduino.cc/en/Tutorial/FileWriteScript
*/
#include <FileIO.h>

View File

@ -1,19 +1,47 @@
/*
Yun HTTP Client
This example for the Arduino Yún shows how create a basic
HTTP client that connects to the internet and downloads
content. In this case, you'll connect to the Arduino
website and download a version of the logo as ASCII text.
created by Tom igoe
May 2013
This example code is in the public domain.
http://arduino.cc/en/Tutorial/HttpClient
*/
#include <Bridge.h>
#include <HttpClient.h>
void setup() {
// Bridge takes about two seconds to start up
// it can be helpful to use the on-board LED
// as an indicator for when it has initialized
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
digitalWrite(13, HIGH);
Serial.begin(9600);
while(!Serial);
while(!Serial); // wait for a serial connection
}
void loop() {
// Initialize the client library
HttpClient client;
// Make a HTTP request:
client.get("http://arduino.cc/asciilogo.txt");
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char c = client.read();
Serial.print(c);

View File

@ -9,6 +9,8 @@
This example code is in the public domain.
http://arduino.cc/en/Tutorial/Process
*/
#include <Process.h>

View File

@ -17,6 +17,8 @@
This example code is in the public domain.
http://arduino.cc/en/Tutorial/ShellCommands
*/
#include <Process.h>

View File

@ -27,10 +27,12 @@
created 6 July 2013
by Tom Igoe
This example code is in the public domain.
http://arduino.cc/en/Tutorial/TemperatureWebPanel
*/
#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>

View File

@ -12,6 +12,8 @@
This example code is in the public domain.
http://arduino.cc/en/Tutorial/TimeCheck
*/

View File

@ -14,6 +14,9 @@
By Federico Fissore
This example code is in the public domain.
http://arduino.cc/en/Tutorial/YunWiFiStatus
*/
#include <Process.h>

View File

@ -8,8 +8,11 @@
updated 27 May 2013
by Tom Igoe
http://arduino.cc/en/Tutorial/YunXivelyClient
*/
// include all Libraries needed:
#include <Process.h>
#include "passwords.h" // contains my passwords, see below

View File

@ -27,8 +27,12 @@
modified by Cristian Maglie
This example code is in the public domain.
http://arduino.cc/en/Tutorial/YunSerialTerminal
*/
long lininoBaud = 250000;
void setup() {