Simple Mbed Cloud client application using features of K64 & K66 including Ethernet and SD Card

Fork of mbed-cloud-example_K64_K66 by Mac Lobdell

DEPRECATED

This example application is not maintained and not recommended. It uses an old version of Mbed OS, Pelion DM, and Arm toolchain. It doesn't work with Mbed Studio.

Please use: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-pelion/

Revision:
4:a107dae867fb
Parent:
2:6ed27f413b30
Child:
5:c18fab181ede
--- a/main.cpp	Wed Feb 14 13:22:50 2018 +0000
+++ b/main.cpp	Wed Feb 14 15:09:00 2018 +0000
@@ -26,7 +26,8 @@
 #include "FATFileSystem.h"
 #include "EthernetInterface.h"
 
-InterruptIn button(BUTTON1);
+// Placeholder to hardware that trigger events (timer, button, etc)
+Ticker timer;
 
 // Pointers to the resources that will be created in main_application().
 static MbedCloudClientResource* pattern_ptr;
@@ -109,8 +110,8 @@
         printf("IP address %s\n", ip_addr);
     }
 
-    // Placeholder for GET requests. Initialize button interrupt.
-    button.fall(&button_press);
+    // Placeholder for callback to update local resource when GET comes.
+    timer.attach(&button_press, 5.0);
 
     SimpleMbedCloudClient mbedClient(&net);
     // Save pointer to mbedClient so that other functions can access it.
@@ -149,7 +150,7 @@
 
         if (button_pressed) {
             button_pressed = false;
-            printf("Button clicked %d times\r\n", ++button_count);
+            printf("Simulated button clicked %d times\r\n", ++button_count);
             button->set_value(button_count);
         }
     }