Skip to content

Commit 853be57

Browse files
committed
Merge remote-tracking branch 'arduino/master' into ide-1.5.x
Conflicts: libraries/Ethernet/examples/XivelyClient/XivelyClient.ino libraries/Ethernet/examples/XivelyClientString/XivelyClientString.ino libraries/GSM/examples/GSMXivelyClient/GSMXivelyClient.ino libraries/GSM/examples/GSMXivelyClientString/GSMXivelyClientString.ino libraries/Servo/examples/Knob/Knob.ino libraries/Servo/examples/Sweep/Sweep.ino libraries/WiFi/examples/WiFiXivelyClient/WiFiXivelyClient.ino libraries/WiFi/examples/WiFiXivelyClientString/WiFiXivelyClientString.ino
2 parents 77635aa + cb9686d commit 853be57

File tree

8 files changed

+125
-112
lines changed

8 files changed

+125
-112
lines changed

libraries/Ethernet/examples/PachubeClient/PachubeClient.ino renamed to libraries/Ethernet/examples/XivelyClient/XivelyClient.ino

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
Pachube sensor client
3-
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
2+
Xively sensor client
3+
4+
This sketch connects an analog sensor to Xively (http://www.xively.com)
55
using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or
66
the Adafruit Ethernet shield, either one will work, as long as it's got
77
a Wiznet Ethernet module on board.
8-
9-
This example has been updated to use version 2.0 of the Pachube.com API.
8+
9+
This example has been updated to use version 2.0 of the Xively.com API.
1010
To make it work, create a feed with a datastream, and give it the ID
1111
sensor1. Or change the code below to match your feed.
1212
@@ -18,16 +18,16 @@
1818
created 15 March 2010
1919
modified 9 Apr 2012
2020
by Tom Igoe with input from Usman Haque and Joe Saavedra
21-
22-
http://arduino.cc/en/Tutorial/PachubeClient
21+
22+
http://arduino.cc/en/Tutorial/XivelyClient
2323
This code is in the public domain.
2424
2525
*/
2626

2727
#include <SPI.h>
2828
#include <Ethernet.h>
2929

30-
#define APIKEY "YOUR API KEY GOES HERE" // replace your pachube api key here
30+
#define APIKEY "YOUR API KEY GOES HERE" // replace your xively api key here
3131
#define FEEDID 00000 // replace your feed ID
3232
#define USERAGENT "My Project" // user agent is the project name
3333

@@ -46,12 +46,12 @@ EthernetClient client;
4646

4747
// if you don't want to use DNS (and reduce your sketch size)
4848
// use the numeric IP instead of the name for the server:
49-
IPAddress server(216, 52, 233, 122); // numeric IP for api.pachube.com
50-
//char server[] = "api.pachube.com"; // name address for pachube API
49+
IPAddress server(216,52,233,122); // numeric IP for api.xively.com
50+
//char server[] = "api.xively.com"; // name address for xively API
5151

5252
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
5353
boolean lastConnected = false; // state of the connection last time through the main loop
54-
const unsigned long postingInterval = 10 * 1000; //delay between updates to Pachube.com
54+
const unsigned long postingInterval = 10*1000; //delay between updates to Xively.com
5555

5656
void setup() {
5757
// Open serial communications and wait for port to open:
@@ -108,8 +108,8 @@ void sendData(int thisData) {
108108
client.print("PUT /v2/feeds/");
109109
client.print(FEEDID);
110110
client.println(".csv HTTP/1.1");
111-
client.println("Host: api.pachube.com");
112-
client.print("X-PachubeApiKey: ");
111+
client.println("Host: api.xively.com");
112+
client.print("X-XivelyApiKey: ");
113113
client.println(APIKEY);
114114
client.print("User-Agent: ");
115115
client.println(USERAGENT);

libraries/Ethernet/examples/PachubeClientString/PachubeClientString.ino renamed to libraries/Ethernet/examples/XivelyClientString/XivelyClientString.ino

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
Cosm sensor client with Strings
3-
4-
This sketch connects an analog sensor to Cosm (http://www.cosm.com)
2+
Xively sensor client with Strings
3+
4+
This sketch connects an analog sensor to Xively (http://www.xively.com)
55
using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or
66
the Adafruit Ethernet shield, either one will work, as long as it's got
77
a Wiznet Ethernet module on board.
8-
9-
This example has been updated to use version 2.0 of the Cosm.com API.
8+
9+
This example has been updated to use version 2.0 of the xively.com API.
1010
To make it work, create a feed with two datastreams, and give them the IDs
1111
sensor1 and sensor2. Or change the code below to match your feed.
1212
@@ -20,8 +20,10 @@
2020
created 15 March 2010
2121
modified 9 Apr 2012
2222
by Tom Igoe with input from Usman Haque and Joe Saavedra
23-
24-
http://arduino.cc/en/Tutorial/CosmClientString
23+
modified 8 September 2012
24+
by Scott Fitzgerald
25+
26+
http://arduino.cc/en/Tutorial/XivelyClientString
2527
This code is in the public domain.
2628
2729
*/
@@ -30,7 +32,7 @@
3032
#include <Ethernet.h>
3133

3234

33-
#define APIKEY "YOUR API KEY GOES HERE" // replace your Cosm api key here
35+
#define APIKEY "YOUR API KEY GOES HERE" // replace your Xively api key here
3436
#define FEEDID 00000 // replace your feed ID
3537
#define USERAGENT "My Project" // user agent is the project name
3638

@@ -50,12 +52,12 @@ EthernetClient client;
5052

5153
// if you don't want to use DNS (and reduce your sketch size)
5254
// use the numeric IP instead of the name for the server:
53-
IPAddress server(216, 52, 233, 121); // numeric IP for api.cosm.com
54-
//char server[] = "api.cosm.com"; // name address for Cosm API
55+
IPAddress server(216,52,233,121); // numeric IP for api.xively.com
56+
//char server[] = "api.xively.com"; // name address for xively API
5557

5658
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
5759
boolean lastConnected = false; // state of the connection last time through the main loop
58-
const unsigned long postingInterval = 10 * 1000; //delay between updates to Cosm.com
60+
const unsigned long postingInterval = 10*1000; //delay between updates to xively.com
5961

6062
void setup() {
6163
// Open serial communications and wait for port to open:
@@ -84,7 +86,7 @@ void loop() {
8486
dataString += sensorReading;
8587

8688
// you can append multiple readings to this String if your
87-
// Cosm feed is set up to handle multiple values:
89+
// xively feed is set up to handle multiple values:
8890
int otherSensorReading = analogRead(A1);
8991
dataString += "\nsensor2,";
9092
dataString += otherSensorReading;
@@ -124,8 +126,8 @@ void sendData(String thisData) {
124126
client.print("PUT /v2/feeds/");
125127
client.print(FEEDID);
126128
client.println(".csv HTTP/1.1");
127-
client.println("Host: api.cosm.com");
128-
client.print("X-CosmApiKey: ");
129+
client.println("Host: api.xively.com");
130+
client.print("X-xivelyApiKey: ");
129131
client.println(APIKEY);
130132
client.print("User-Agent: ");
131133
client.println(USERAGENT);

libraries/GSM/examples/GSMPachubeClient/GSMPachubeClient.ino renamed to libraries/GSM/examples/GSMXivelyClient/GSMXivelyClient.ino

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
GSM Pachube client
3-
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
2+
GSM Xively client
3+
4+
This sketch connects an analog sensor to Xively (http://www.xively.com)
55
using a Telefonica GSM/GPRS shield.
66
7-
This example has been updated to use version 2.0 of the Pachube.com API.
7+
This example has been updated to use version 2.0 of the Xively.com API.
88
To make it work, create a feed with a datastream, and give it the ID
99
sensor1. Or change the code below to match your feed.
1010
@@ -18,16 +18,16 @@
1818
and adapted for GSM shield by David Del Peral
1919
2020
This code is in the public domain.
21-
22-
http://arduino.cc/en/Tutorial/GSMExamplesPachubeClient
23-
21+
22+
http://arduino.cc/en/Tutorial/GSMExamplesXivelyClient
23+
2424
*/
2525

2626
// libraries
2727
#include <GSM.h>
2828

29-
// Pachube Client data
30-
#define APIKEY "YOUR API KEY GOES HERE" // replace your pachube api key here
29+
// Xively Client data
30+
#define APIKEY "YOUR API KEY GOES HERE" // replace your xively api key here
3131
#define FEEDID 00000 // replace your feed ID
3232
#define USERAGENT "My Project" // user agent is the project name
3333

@@ -46,12 +46,12 @@ GSM gsmAccess;
4646

4747
// if you don't want to use DNS (and reduce your sketch size)
4848
// use the numeric IP instead of the name for the server:
49-
// IPAddress server(216,52,233,121); // numeric IP for api.pachube.com
50-
char server[] = "api.pachube.com"; // name address for pachube API
49+
// IPAddress server(216,52,233,121); // numeric IP for api.xively.com
50+
char server[] = "api.xively.com"; // name address for xively API
5151

5252
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
5353
boolean lastConnected = false; // state of the connection last time through the main loop
54-
const unsigned long postingInterval = 10 * 1000; //delay between updates to Pachube.com
54+
const unsigned long postingInterval = 10*1000; //delay between updates to Xively.com
5555

5656
void setup()
5757
{
@@ -126,7 +126,7 @@ void sendData(int thisData)
126126
client.print("PUT /v2/feeds/");
127127
client.print(FEEDID);
128128
client.println(".csv HTTP/1.1");
129-
client.println("Host: api.pachube.com");
129+
client.println("Host: api.xively.com");
130130
client.print("X-ApiKey: ");
131131
client.println(APIKEY);
132132
client.print("User-Agent: ");

libraries/GSM/examples/GSMPachubeClientString/GSMPachubeClientString.ino renamed to libraries/GSM/examples/GSMXivelyClientString/GSMXivelyClientString.ino

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
Pachube client with Strings
3-
4-
This sketch connects two analog sensors to Pachube (http://www.pachube.com)
2+
Xively client with Strings
3+
4+
This sketch connects two analog sensors to Xively (http://www.xively.com)
55
through a Telefonica GSM/GPRS shield.
6-
7-
This example has been updated to use version 2.0 of the Pachube.com API.
6+
7+
This example has been updated to use version 2.0 of the Xively.com API.
88
To make it work, create a feed with two datastreams, and give them the IDs
99
sensor1 and sensor2. Or change the code below to match your feed.
1010
@@ -27,8 +27,8 @@
2727
// Include the GSM library
2828
#include <GSM.h>
2929

30-
// Pachube login information
31-
#define APIKEY "YOUR API KEY GOES HERE" // replace your pachube api key here
30+
// Xively login information
31+
#define APIKEY "YOUR API KEY GOES HERE" // replace your xively api key here
3232
#define FEEDID 00000 // replace your feed ID
3333
#define USERAGENT "My Project" // user agent is the project name
3434

@@ -47,12 +47,12 @@ GSM gsmAccess;
4747

4848
// if you don't want to use DNS (and reduce your sketch size)
4949
// use the numeric IP instead of the name for the server:
50-
// IPAddress server(216,52,233,121); // numeric IP for api.pachube.com
51-
char server[] = "api.pachube.com"; // name address for Pachube API
50+
// IPAddress server(216,52,233,121); // numeric IP for api.xively.com
51+
char server[] = "api.xively.com"; // name address for Xively API
5252

5353
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
5454
boolean lastConnected = false; // state of the connection last time through the main loop
55-
const unsigned long postingInterval = 10 * 1000; // delay between updates to Pachube.com
55+
const unsigned long postingInterval = 10*1000; // delay between updates to Xively.com
5656

5757
void setup()
5858
{
@@ -91,8 +91,8 @@ void loop()
9191
String dataString = "sensor1,";
9292
dataString += sensorReading;
9393

94-
// you can append multiple readings to this String to
95-
// send the pachube feed multiple values
94+
// you can append multiple readings to this String to
95+
// send the xively feed multiple values
9696
int otherSensorReading = analogRead(A1);
9797
dataString += "\nsensor2,";
9898
dataString += otherSensorReading;
@@ -138,7 +138,7 @@ void sendData(String thisData)
138138
client.print("PUT /v2/feeds/");
139139
client.print(FEEDID);
140140
client.println(".csv HTTP/1.1");
141-
client.println("Host: api.pachube.com");
141+
client.println("Host: api.xively.com");
142142
client.print("X-ApiKey: ");
143143
client.println(APIKEY);
144144
client.print("User-Agent: ");
+16-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
// Controlling a servo position using a potentiometer (variable resistor)
2-
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
1+
/*
2+
Controlling a servo position using a potentiometer (variable resistor)
3+
by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
4+
5+
modified on 8 Nov 2013
6+
by Scott Fitzgerald
7+
http://arduino.cc/en/Tutorial/Knob
8+
*/
39

410
#include <Servo.h>
511

@@ -13,10 +19,11 @@ void setup()
1319
myservo.attach(9); // attaches the servo on pin 9 to the servo object
1420
}
1521

16-
void loop()
17-
{
18-
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
19-
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
20-
myservo.write(val); // sets the servo position according to the scaled value
21-
delay(15); // waits for the servo to get there
22-
}
22+
void loop()
23+
{
24+
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
25+
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180)
26+
myservo.write(val); // sets the servo position according to the scaled value
27+
delay(15); // waits for the servo to get there
28+
}
29+

libraries/Servo/examples/Sweep/Sweep.ino

+32-28
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
1-
// Sweep
2-
// by BARRAGAN <http://barraganstudio.com>
3-
// This example code is in the public domain.
1+
/* Sweep
2+
by BARRAGAN <http://barraganstudio.com>
3+
This example code is in the public domain.
44
5+
modified 8 Nov 2013
6+
by Scott Fitzgerald
7+
http://arduino.cc/en/Tutorial/Sweep
8+
*/
59

6-
#include <Servo.h>
10+
#include <Servo.h>
11+
12+
Servo myservo; // create servo object to control a servo
13+
// twelve servo objects can be created on most boards
14+
15+
int pos = 0; // variable to store the servo position
16+
17+
void setup()
18+
{
19+
myservo.attach(9); // attaches the servo on pin 9 to the servo object
20+
}
21+
22+
void loop()
23+
{
24+
for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees
25+
{ // in steps of 1 degree
26+
myservo.write(pos); // tell servo to go to position in variable 'pos'
27+
delay(15); // waits 15ms for the servo to reach the position
28+
}
29+
for(pos = 180; pos>=0; pos-=1) // goes from 180 degrees to 0 degrees
30+
{
31+
myservo.write(pos); // tell servo to go to position in variable 'pos'
32+
delay(15); // waits 15ms for the servo to reach the position
33+
}
34+
}
735

8-
Servo myservo; // create servo object to control a servo
9-
// a maximum of eight servo objects can be created
10-
11-
int pos = 0; // variable to store the servo position
12-
13-
void setup()
14-
{
15-
myservo.attach(9); // attaches the servo on pin 9 to the servo object
16-
}
17-
18-
19-
void loop()
20-
{
21-
for (pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
22-
{ // in steps of 1 degree
23-
myservo.write(pos); // tell servo to go to position in variable 'pos'
24-
delay(15); // waits 15ms for the servo to reach the position
25-
}
26-
for (pos = 180; pos >= 1; pos -= 1) // goes from 180 degrees to 0 degrees
27-
{
28-
myservo.write(pos); // tell servo to go to position in variable 'pos'
29-
delay(15); // waits 15ms for the servo to reach the position
30-
}
31-
}

0 commit comments

Comments
 (0)