File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
examples/WiFiShield-Simple Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11/* *
2- * @file WiFi Sensor example
2+ * @file hackAIR WiFi Shield - Simple Example
33 * This example reads data from a sensor (default choice is the serial SDS011)
4- * and sends it to the hackAIR servers using the hackAIR WiFi Shield.
4+ * and sends it to the hackAIR servers using the hackAIR WiFi Shield every 10 minutes.
5+ *
6+ * @author Thanasis Georgiou
57 *
68 * This example is part of the hackAIR Arduino Library and is available
79 * in the Public Domain.
@@ -25,11 +27,12 @@ void setup() {
2527 // Wait for WiFi connection
2628 // At this point you should use your mobile phone to setup the WiFi connection
2729 wifi_waitForReady ();
28- // Set authentication token
29- wifi_setToken (" REPLACE WITH AUTHENTICATION TOKEN" );
30+ // Set the authorization token
31+ wifi_setToken (" AUTHORIZATION TOKEN" );
3032}
3133
3234void loop () {
35+ sensor.clearData (data);
3336 sensor.refresh (data);
3437
3538 // Average readings
@@ -60,4 +63,7 @@ void loop() {
6063 data.pm10 = pm10;
6164 data.error = error;
6265 wifi_sendData (data);
66+
67+ // Wait 10 minutes
68+ delay (10 * 60 * 1000UL );
6369}
You can’t perform that action at this time.
0 commit comments