mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Updated XivelyClient to use Serial instead of Console
This commit is contained in:
parent
7fae00bce4
commit
7b25e85a56
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,3 +26,5 @@ test-bin
|
|||||||
.idea
|
.idea
|
||||||
|
|
||||||
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
|
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
|
||||||
|
|
||||||
|
hardware/arduino/avr/libraries/Bridge/examples/.DS_Store
|
||||||
|
@ -33,10 +33,10 @@ String dataString = "";
|
|||||||
void setup() {
|
void setup() {
|
||||||
// start serial port:
|
// start serial port:
|
||||||
Bridge.begin();
|
Bridge.begin();
|
||||||
Console.begin();
|
Serial.begin(9600);
|
||||||
|
|
||||||
while(!Console); // wait for Network Console to open
|
while(!Serial); // wait for Network Serial to open
|
||||||
Console.println("Xively client");
|
Serial.println("Xively client");
|
||||||
|
|
||||||
// Do a first update immediately
|
// Do a first update immediately
|
||||||
updateData();
|
updateData();
|
||||||
@ -83,7 +83,7 @@ void sendData() {
|
|||||||
// sendData function finishes the resources are immediately
|
// sendData function finishes the resources are immediately
|
||||||
// released. Declaring it global works too, BTW.
|
// released. Declaring it global works too, BTW.
|
||||||
Process xively;
|
Process xively;
|
||||||
Console.print("\n\nSending data... ");
|
Serial.print("\n\nSending data... ");
|
||||||
xively.begin("curl");
|
xively.begin("curl");
|
||||||
xively.addParameter("-k");
|
xively.addParameter("-k");
|
||||||
xively.addParameter("--request");
|
xively.addParameter("--request");
|
||||||
@ -94,13 +94,13 @@ void sendData() {
|
|||||||
xively.addParameter(apiString);
|
xively.addParameter(apiString);
|
||||||
xively.addParameter(url);
|
xively.addParameter(url);
|
||||||
xively.run();
|
xively.run();
|
||||||
Console.println("done!");
|
Serial.println("done!");
|
||||||
|
|
||||||
// If there's incoming data from the net connection,
|
// If there's incoming data from the net connection,
|
||||||
// send it out the Console:
|
// send it out the Serial:
|
||||||
while (xively.available()>0) {
|
while (xively.available()>0) {
|
||||||
char c = xively.read();
|
char c = xively.read();
|
||||||
Console.write(c);
|
Serial.write(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user