Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-cloud-example_K64_K66 by
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/
Diff: main.cpp
- Revision:
- 4:a107dae867fb
- Parent:
- 2:6ed27f413b30
- Child:
- 5:c18fab181ede
diff -r bd00f3af8f03 -r a107dae867fb main.cpp
--- 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);
}
}

