Hardware Reference
In-Depth Information
client.println();
}
After the data is sent, we read back the data that comes from the Xively server:
while (client.connected()) {
while (client.available()) {
char c = client.read();
Serial.print(c);
}
}
Then, we disconnect the chip from the local network:
cc3000.disconnect();
We repeat the procedure every 10 seconds:
delay(10000);
It's now time to test the sketch.
Note
The code for this part can be found on the GitHub repository of the topic on the following
web page:
https://github.com/openhomeautomation/arduino-home-automation/tree/master/chapter5
You can upload the sketch to your Arduino board and open the serial monitor. You should
see that the sketch is connecting to the Wi-Fi network, sending data to Xively, and getting
the confirmation message from the server.
You can also check whether the data was correctly received on the device page on Xively,
as shown in the following screenshot:
Search WWH ::




Custom Search