aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'libraries')
-rw-r--r--libraries/Bridge/examples/XivelyClient/XivelyClient.ino32
-rw-r--r--libraries/Bridge/examples/XivelyClient/passwords.h5
-rw-r--r--libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino4
3 files changed, 21 insertions, 20 deletions
diff --git a/libraries/Bridge/examples/XivelyClient/XivelyClient.ino b/libraries/Bridge/examples/XivelyClient/XivelyClient.ino
index be04d40..ab1c8bc 100644
--- a/libraries/Bridge/examples/XivelyClient/XivelyClient.ino
+++ b/libraries/Bridge/examples/XivelyClient/XivelyClient.ino
@@ -25,11 +25,7 @@
#define APIKEY "foo" // replace your pachube api key here
#define FEEDID 0000 // replace your feed ID
#define USERAGENT "my-project" // user agent is the project name
-
- char ssid[] = "networkname"; // your network SSID (name)
- char pass[] = "password"; // your network password
-
- */
+ */
// set up net client info:
@@ -44,12 +40,13 @@ void setup() {
Serial.begin(9600);
Bridge.begin();
delay(2000);
-
+
while(!Serial); // wait for Serial Monitor to open
Serial.println("Xively client");
-
+
// reserve space for dataString:
dataString.reserve(100);
+ sendData();
}
void loop() {
@@ -64,9 +61,8 @@ void loop() {
dataString += random(5) + 100;
// if there's incoming data from the net connection,
- // send it out the serial port. This is for debugging
- // purposes only:
- while (xively.available()>0) {
+ // send it out the serial port:
+ if (xively.available()>0) {
char c = xively.read();
Serial.write(c);
}
@@ -83,7 +79,6 @@ void loop() {
// this method makes a HTTP connection to the server:
void sendData() {
Serial.println("Sending data");
- xively.begin("curl");
dataString = "--data \'" + dataString;
dataString += "\'";
@@ -93,12 +88,13 @@ void sendData() {
apiString += "\"";
// form the string for the URL parameter:
- String url = " https://api.xively.com/v2/feeds/";
+ String url = " \"https://api.xively.com/v2/feeds/";
url += FEEDID;
- url += ".csv";
-
+ url += ".csv\"";
+
// send the HTTP PUT request:
- xively.addParameter(" -k");
+ xively.begin("curl");
+ xively.addParameter("-k");
xively.addParameter("--request PUT");
xively.addParameter(dataString);
xively.addParameter(apiString);
@@ -108,3 +104,9 @@ void sendData() {
+
+
+
+
+
+
diff --git a/libraries/Bridge/examples/XivelyClient/passwords.h b/libraries/Bridge/examples/XivelyClient/passwords.h
deleted file mode 100644
index 0c6fa14..0000000
--- a/libraries/Bridge/examples/XivelyClient/passwords.h
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#define APIKEY "XXXXXXXX" // replace your pachube api key here
-#define FEEDID 00000 // replace your feed ID
-#define USERAGENT "home-sensors" // user agent is the project name
-
diff --git a/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino b/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
index 1df7784..019babf 100644
--- a/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
+++ b/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
@@ -20,7 +20,11 @@
This example code is in the public domain.
*/
+<<<<<<< HEAD
+long baud = 9600;
+=======
long baud = 57600;
+>>>>>>> 113e28d86188899e529ced3fed04e4116e3f5a88
// Pin 13 has an LED connected on most Arduino boards.
// give it a name: