Skip to content

Commit cb9686d

Browse files
committed
Updates to a number of Examples
removed pachube examples, added xively examples. changes to the Servo examples
1 parent 89d6841 commit cb9686d

File tree

11 files changed

+78
-530
lines changed

11 files changed

+78
-530
lines changed

libraries/Ethernet/examples/TwitterClient/TwitterClient.ino

-136
This file was deleted.

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
Pachube sensor client
2+
Xively sensor client
33
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
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.
88
9-
This example has been updated to use version 2.0 of the Pachube.com API.
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
@@ -19,15 +19,15 @@
1919
modified 9 Apr 2012
2020
by Tom Igoe with input from Usman Haque and Joe Saavedra
2121
22-
http://arduino.cc/en/Tutorial/PachubeClient
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

@@ -45,12 +45,12 @@ EthernetClient client;
4545

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

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

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

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
Pachube sensor client with Strings
2+
Xively sensor client with Strings
33
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
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.
88
9-
This example has been updated to use version 2.0 of the pachube.com API.
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
@@ -23,7 +23,7 @@
2323
modified 8 September 2012
2424
by Scott Fitzgerald
2525
26-
http://arduino.cc/en/Tutorial/PachubeClientString
26+
http://arduino.cc/en/Tutorial/XivelyClientString
2727
This code is in the public domain.
2828
2929
*/
@@ -32,7 +32,7 @@
3232
#include <Ethernet.h>
3333

3434

35-
#define APIKEY "YOUR API KEY GOES HERE" // replace your Pachube api key here
35+
#define APIKEY "YOUR API KEY GOES HERE" // replace your Xively api key here
3636
#define FEEDID 00000 // replace your feed ID
3737
#define USERAGENT "My Project" // user agent is the project name
3838

@@ -51,12 +51,12 @@ EthernetClient client;
5151

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

5757
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
5858
boolean lastConnected = false; // state of the connection last time through the main loop
59-
const unsigned long postingInterval = 10*1000; //delay between updates to pachube.com
59+
const unsigned long postingInterval = 10*1000; //delay between updates to xively.com
6060

6161
void setup() {
6262
// Open serial communications and wait for port to open:
@@ -85,7 +85,7 @@ void loop() {
8585
dataString += sensorReading;
8686

8787
// you can append multiple readings to this String if your
88-
// pachube feed is set up to handle multiple values:
88+
// xively feed is set up to handle multiple values:
8989
int otherSensorReading = analogRead(A1);
9090
dataString += "\nsensor2,";
9191
dataString += otherSensorReading;
@@ -125,8 +125,8 @@ void sendData(String thisData) {
125125
client.print("PUT /v2/feeds/");
126126
client.print(FEEDID);
127127
client.println(".csv HTTP/1.1");
128-
client.println("Host: api.pachube.com");
129-
client.print("X-pachubeApiKey: ");
128+
client.println("Host: api.xively.com");
129+
client.print("X-xivelyApiKey: ");
130130
client.println(APIKEY);
131131
client.print("User-Agent: ");
132132
client.println(USERAGENT);

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
GSM Pachube client
2+
GSM Xively client
33
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
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
@@ -19,15 +19,15 @@
1919
2020
This code is in the public domain.
2121
22-
http://arduino.cc/en/Tutorial/GSMExamplesPachubeClient
22+
http://arduino.cc/en/Tutorial/GSMExamplesXivelyClient
2323
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

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
Pachube client with Strings
2+
Xively client with Strings
33
4-
This sketch connects two analog sensors to Pachube (http://www.pachube.com)
4+
This sketch connects two analog sensors to Xively (http://www.xively.com)
55
through 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 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
{
@@ -92,7 +92,7 @@ void loop()
9292
dataString += sensorReading;
9393

9494
// you can append multiple readings to this String to
95-
// send the pachube feed multiple values
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: ");

0 commit comments

Comments
 (0)