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.
Revision 0:3d1898f330d9, committed 2014-02-20
- Comitter:
- DAMEK
- Date:
- Thu Feb 20 12:11:55 2014 +0000
- Commit message:
- led, ticker, interruptin, sleepmode
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 3d1898f330d9 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Feb 20 12:11:55 2014 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+/**
+ * @file main.cpp
+ * @brief main file.
+ *
+ * @addtogroup FirstRun
+ * @author Andreas Rehn
+ * @date 20.02.2014
+ * @brief Main module to test led, button und sleepmode together
+ * @warning functions run with sleep() and with deepsleep() the system must be start up with InterruptIn
+ * @{
+ */
+
+Ticker flipper;
+InterruptIn button(USER_BUTTON);
+DigitalOut led(LED1);
+
+/** function to flip the led */
+void flip(void) {
+ led = !led;
+}
+
+/** main function
+ * initial param for led \n
+ * call function flip on rising edge of Button \n
+ * attach function flip to Ticker with 2 seconds intervall \n
+ * go to sleep or deepsleep (test the difference) \n
+ */
+int main(void) {
+ led = 1;
+ button.rise(&flip);
+ flipper.attach(&flip, 2.0);
+ sleep();
+ //deepsleep();
+ while(1) {
+ }
+}
+/** @} */
\ No newline at end of file
diff -r 000000000000 -r 3d1898f330d9 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Feb 20 12:11:55 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4 \ No newline at end of file