1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03: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,32 +1,25 @@
/* /*
Bridge Arduino Yun Bridge example
This example shows how to use the Bridge library to access the digital This example for the Arduino Yun shows how to use the
and analog pins on the board through REST calls. Bridge library to access the digital and analog pins
It demonstrates how you can create your own API when using REST style on the board through REST calls. It demonstrates how
you can create your own API when using REST style
calls through the browser. calls through the browser.
Example of possible commands are listed here: Possible commands created in this shetch:
"/arduino/digital/13" -> digitalRead(13) * "digital/13" -> digitalRead(13)
"/arduino/digital/13/1" -> digitalWrite(13, HIGH) * "digital/13/1" -> digitalWrite(13, HIGH)
"/arduino/analog/2/123" -> analogWrite(2, 123) * "analog/2/123" -> analogWrite(2, 123)
"/arduino/analog/2" -> analogRead(2) * "analog/2" -> analogRead(2)
"/arduino/mode/13/input" -> pinMode(13, INPUT) * "mode/13/input" -> pinMode(13, INPUT)
"/arduino/mode/13/output" -> pinMode(13, OUTPUT) * "mode/13/output" -> pinMode(13, OUTPUT)
The circuit: http://arduino.cc/en/Tutorial/Bridge
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 This example code is part of the public domain
by Cristian Maglie */
This example code is in the public domain.
*/
#include <Bridge.h> #include <Bridge.h>
#include <YunServer.h> #include <YunServer.h>

View File

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

View File

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

View File

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

View File

@ -9,6 +9,8 @@
This example code is in the public domain. This example code is in the public domain.
http://arduino.cc/en/Tutorial/FileWriteScript
*/ */
#include <FileIO.h> #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 <Bridge.h>
#include <HttpClient.h> #include <HttpClient.h>
void setup() { 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); pinMode(13, OUTPUT);
digitalWrite(13, LOW); digitalWrite(13, LOW);
Bridge.begin(); Bridge.begin();
digitalWrite(13, HIGH);
Serial.begin(9600); Serial.begin(9600);
while(!Serial);
while(!Serial); // wait for a serial connection
} }
void loop() { void loop() {
// Initialize the client library
HttpClient client; HttpClient client;
// Make a HTTP request:
client.get("http://arduino.cc/asciilogo.txt"); client.get("http://arduino.cc/asciilogo.txt");
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) { while (client.available()) {
char c = client.read(); char c = client.read();
Serial.print(c); Serial.print(c);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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