3 #include <HttpClient.h>
6 // MAC address for your Ethernet shield
7 byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
9 // Your Xively key to let you upload data
10 char xivelyKey[] = "YOUR_XIVELY_API_KEY";
12 // Define the string for our datastream ID
13 char temperatureId[] = "temperature";
15 XivelyDatastream datastreams[] = {
16 XivelyDatastream(temperatureId, strlen(temperatureId), DATASTREAM_FLOAT),
18 // Finally, wrap the datastreams into a feed
19 XivelyFeed feed(15552, datastreams, 1 /* number of datastreams */);
21 EthernetClient client;
22 XivelyClient xivelyclient(client);
25 // put your setup code here, to run once:
28 Serial.println("Reading from Xively example");
31 while (Ethernet.begin(mac) != 1)
33 Serial.println("Error getting IP address via DHCP, trying again...");
39 int ret = xivelyclient.get(feed, xivelyKey);
40 Serial.print("xivelyclient.get returned ");
45 Serial.println("Datastream is...");
46 Serial.println(feed[0]);
48 Serial.print("Temperature is: ");
49 Serial.println(feed[0].getFloat());