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 Carey Williams

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Tue Sep 26 11:45:04 2017 +0100
Parent:
34:297e06ef6c8f
Child:
36:aa0b6789bbd2
Commit message:
Get rid of \r\n by adding newlines to mbed_app.json

We can do it in the `mbed_app.json`, rather than in every single
`printf()` line.

.
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
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Sep 26 11:15:03 2017 +0100
+++ b/main.cpp	Tue Sep 26 11:45:04 2017 +0100
@@ -63,7 +63,7 @@
 {
     WiFiAccessPoint *ap;
 
-    printf("Scan:\r\n");
+    printf("Scan:\n");
 
     int count = wifi->scan(NULL,0);
 
@@ -74,11 +74,11 @@
     count = wifi->scan(ap, count);
     for (int i = 0; i < count; i++)
     {
-        printf("Network: %s secured: %s BSSID: %hhX:%hhX:%hhX:%hhx:%hhx:%hhx RSSI: %hhd Ch: %hhd\r\n", ap[i].get_ssid(),
+        printf("Network: %s secured: %s BSSID: %hhX:%hhX:%hhX:%hhx:%hhx:%hhx RSSI: %hhd Ch: %hhd\n", ap[i].get_ssid(),
                sec2str(ap[i].get_security()), ap[i].get_bssid()[0], ap[i].get_bssid()[1], ap[i].get_bssid()[2],
                ap[i].get_bssid()[3], ap[i].get_bssid()[4], ap[i].get_bssid()[5], ap[i].get_rssi(), ap[i].get_channel());
     }
-    printf("%d networks available.\r\n", count);
+    printf("%d networks available.\n", count);
 
     delete[] ap;
 }
@@ -88,13 +88,13 @@
     TCPSocket socket;
     nsapi_error_t response;
 
-    printf("Sending HTTP request to www.arm.com...\r\n");
+    printf("Sending HTTP request to www.arm.com...\n");
 
     // Open a socket on the network interface, and create a TCP connection to www.arm.com
     socket.open(net);
     response = socket.connect("www.arm.com", 80);
     if(0 != response) {
-        printf("Error connecting: %d\r\n", response);
+        printf("Error connecting: %d\n", response);
         socket.close();
         return;
     }
@@ -107,13 +107,13 @@
     {
         response = socket.send(sbuffer+response, size);
         if (response < 0) {
-            printf("Error sending data: %d\r\n", response);
+            printf("Error sending data: %d\n", response);
             socket.close();
             return;
         } else {
             size -= response;
             // Check if entire message was sent or not
-            printf("sent %d [%.*s]\r\n", response, strstr(sbuffer, "\r\n")-sbuffer, sbuffer);
+            printf("sent %d [%.*s]\n", response, strstr(sbuffer, "\r\n")-sbuffer, sbuffer);
         }
     }
 
@@ -121,9 +121,9 @@
     char rbuffer[64];
     response = socket.recv(rbuffer, sizeof rbuffer);
     if (response < 0) {
-        printf("Error receiving data: %d\r\n", response);
+        printf("Error receiving data: %d\n", response);
     } else {
-        printf("recv %d [%.*s]\r\n", response, strstr(rbuffer, "\r\n")-rbuffer, rbuffer);
+        printf("recv %d [%.*s]\n", response, strstr(rbuffer, "\r\n")-rbuffer, rbuffer);
     }
 
     // Close the socket to return its memory and bring down the network interface
@@ -132,27 +132,27 @@
 
 int main()
 {
-    printf("WiFi example\r\n\r\n");
+    printf("WiFi example\n\n");
 
     scan_demo(&wifi);
 
-    printf("\r\nConnecting...\r\n");
+    printf("\nConnecting...\n");
     int ret = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
     if (ret != 0) {
-        printf("\r\nConnection error\r\n");
+        printf("\nConnection error\n");
         return -1;
     }
 
-    printf("Success\r\n\r\n");
-    printf("MAC: %s\r\n", wifi.get_mac_address());
-    printf("IP: %s\r\n", wifi.get_ip_address());
-    printf("Netmask: %s\r\n", wifi.get_netmask());
-    printf("Gateway: %s\r\n", wifi.get_gateway());
-    printf("RSSI: %d\r\n\r\n", wifi.get_rssi());
+    printf("Success\n\n");
+    printf("MAC: %s\n", wifi.get_mac_address());
+    printf("IP: %s\n", wifi.get_ip_address());
+    printf("Netmask: %s\n", wifi.get_netmask());
+    printf("Gateway: %s\n", wifi.get_gateway());
+    printf("RSSI: %d\n\n", wifi.get_rssi());
 
     http_demo(&wifi);
 
     wifi.disconnect();
 
-    printf("\r\nDone\r\n");
+    printf("\nDone\n");
 }
--- a/mbed_app.json	Tue Sep 26 11:15:03 2017 +0100
+++ b/mbed_app.json	Tue Sep 26 11:45:04 2017 +0100
@@ -22,6 +22,9 @@
         }
     },
     "target_overrides": {
+        "*": {
+            "platform.stdio-convert-newlines": true
+        },
         "UBLOX_EVK_ODIN_W2": {
             "target.device_has": ["EMAC"]
         },