You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
Cosm Arduino library
1
+
Xively Arduino library
2
2
================
3
3
4
-
A library for Arduino to make it easier to talk to Cosm (the service formerly known as Pachube).
4
+
A library for Arduino to make it easier to talk to Xively (the service formerly known as Pachube).
5
5
6
6
This library **requires** the HTTP Client library at https://github.com/amcewen/HttpClient
7
7
@@ -18,21 +18,21 @@ This library **requires** the HTTP Client library at https://github.com/amcewen/
18
18
##For a Quickstart Example
19
19
Look no further! If you want a quick example, connect your Arduino board to your computer and an ethernet cable and try out one of the examples included with this library.
20
20
21
-
>In Arduino, go to Files > Examples and choose DatastreamUpload or DatastreamDownload from the cosm-arduino library folder
21
+
>In Arduino, go to Files > Examples and choose DatastreamUpload or DatastreamDownload from the xively-arduino library folder
22
22
23
23
##Setup Your Sketch
24
24
25
25
**1. Specify your API key and Feed ID**
26
26
```c
27
-
charcosmKey[] = "YOUR_COSM_API_KEY";
27
+
charxivelyKey[] = "YOUR_XIVELY_API_KEY";
28
28
// Should be something like "HsNiCoe_Es2YYWltKeRFPZL2xhqSAKxIV21aV3lTL2h5OD0g"
29
29
#defineFEED_ID XXXXXX
30
-
// The 3 to 6-digit number (like 504 or 104097), that identifies the Cosm Feed you're using
30
+
// The 3 to 6-digit number (like 504 or 104097), that identifies the Xively Feed you're using
31
31
```
32
32
33
33
**2. Create IDs for your datastreams as `char` arrays (or `String` objects for a `String` datastream)**
34
34
35
-
In Cosm, the name of a datastream is known as the **Stream ID**. In the example below, we'll give the datastreams names by setting their **Stream IDs** as "humidity", "temperature", "my_thoughts_on_the_temperature" and "more_thoughts".
35
+
In Xively, the name of a datastream is known as the **Stream ID**. In the example below, we'll give the datastreams names by setting their **Stream IDs** as "humidity", "temperature", "my_thoughts_on_the_temperature" and "more_thoughts".
36
36
37
37
```c
38
38
// For datastreams of floats:
@@ -47,26 +47,26 @@ const int bufferSize = 140; // size of the array
47
47
char bufferValue[bufferSize]; // the array of chars itself
48
48
```
49
49
50
-
`String` datastreams and `char` buffer datastreams are similar: both will be able to send strings to Cosm datastreams. For beginners, using `String` datastreams will be fine much of the time.
50
+
`String` datastreams and `char` buffer datastreams are similar: both will be able to send strings to Xively datastreams. For beginners, using `String` datastreams will be fine much of the time.
51
51
52
-
Using char buffers reduces the memory footprint of your sketch by not requiring the String library. Also, using char buffers allows you to specify exactly how much memory is used for a datapoint, so you don't accidentally overflow the Arduino's mem capacity with a huge string datapoint. It's a little bit harder to understand for beginners -- consult CosmDatastream.cpp for info.
52
+
Using char buffers reduces the memory footprint of your sketch by not requiring the String library. Also, using char buffers allows you to specify exactly how much memory is used for a datapoint, so you don't accidentally overflow the Arduino's mem capacity with a huge string datapoint. It's a little bit harder to understand for beginners -- consult XivelyDatastream.cpp for info.
53
53
54
-
**3. Create an array of `CosmDatastream` objects**
54
+
**3. Create an array of `XivelyDatastream` objects**
`CosmDatastream` objects can contains some or all of the following variables, depending on what type of datapoints are in the datastream (see above example for which are required):
69
+
`XivelyDatastream` objects can contains some or all of the following variables, depending on what type of datapoints are in the datastream (see above example for which are required):
| 5 | aValueBufferLength | int | The number of elements in the `char` array
78
78
79
79
80
-
**4. Last, wrap this array of `CosmDatastream` objects into a `CosmFeed`**
80
+
**4. Last, wrap this array of `XivelyDatastream` objects into a `XivelyFeed`**
81
81
82
-
Unlike the **Stream ID**, which is what a _Datastream's_ name is stored as, the **ID** of a _Feed_ is a number which is used to uniquely identify which Cosm Feed you are addressing. For example, a Feed **ID** of 504 would mean that you were using the feed at cosm.com/feeds/504.
82
+
Unlike the **Stream ID**, which is what a _Datastream's_ name is stored as, the **ID** of a _Feed_ is a number which is used to uniquely identify which Xively Feed you are addressing. For example, a Feed **ID** of 504 would mean that you were using the feed at xively.com/feeds/504.
83
83
84
84
```c
85
-
CosmFeedfeed(FEED_ID, datastreams, 4);
85
+
XivelyFeedfeed(FEED_ID, datastreams, 4);
86
86
```
87
87
88
88
| | Variable | Type | Description |
89
89
|---|---|:---:|---|
90
90
| 1 | aID | unsigned long | The Feed's **ID**, as defined at the top of your sketch
0 commit comments