Andreas Rehn / Mbed 2 deprecated Nucleo_firstRun_test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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