Deep Slumber, codename ISA, is a program made for the arm MBED during Hack The Burgh 2018 that analyses light, temperature, humidity and CO2 levels in a room. It uploads this information onto an SQL server through a rest API, providing the necessary environment for data processing. Further improvements we hope to provide are the regulation of said parameters by wifi connection to electric heaters, wifi enabled controllable lightbulbs and other iot gadgets as well as a website that will provide recommendations for sleep cycle improvements.
Dependencies: C12832 CCS811 Sht31 TSL2561
Fork of ARM_HACK_THE_BURGH by
Revision 37:3a31525e2971, committed 2017-09-29
- Comitter:
- mbed_official
- Date:
- Fri Sep 29 10:15:04 2017 +0100
- Parent:
- 36:aa0b6789bbd2
- Child:
- 38:eb18932eacc5
- Commit message:
- Continue exmaple only if WIFI APNs are found
Stop the example if there are 0 APNs found in the scan.
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-wifi
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 27 11:15:04 2017 +0100
+++ b/main.cpp Fri Sep 29 10:15:04 2017 +0100
@@ -59,7 +59,7 @@
}
}
-void scan_demo(WiFiInterface *wifi)
+int scan_demo(WiFiInterface *wifi)
{
WiFiAccessPoint *ap;
@@ -81,6 +81,7 @@
printf("%d networks available.\n", count);
delete[] ap;
+ return count;
}
void http_demo(NetworkInterface *net)
@@ -132,11 +133,17 @@
int main()
{
+ int count = 0;
+
printf("WiFi example\n\n");
- scan_demo(&wifi);
+ count = scan_demo(&wifi);
+ if (count == 0) {
+ printf("No WIFI APNs found - can't continue further.\n");
+ return -1;
+ }
- printf("\nConnecting...\n");
+ printf("\nConnecting to %s...\n", MBED_CONF_APP_WIFI_SSID);
int ret = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
if (ret != 0) {
printf("\nConnection error\n");
