Skip to content

Commit 0873c7a

Browse files
committed
Clean up the Simple WiFi example (fix license, etc)
1 parent d0cc18f commit 0873c7a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

examples/WiFiShield-Simple/WiFiShield-Simple.ino

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
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

3234
void 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
}

0 commit comments

Comments
 (0)