Alexander Leber / Mbed 2 deprecated m0_TasterCounter10V2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
DoTTi
Date:
Thu Jan 21 16:26:59 2016 +0000
Commit message:
DigitalIO Aufgabe 14

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jan 21 16:26:59 2016 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+ 
+DigitalOut myled(LED1);
+DigitalIn taster(P0_10);
+
+int main()
+{
+int counter=-1;
+int tasteralt=1;
+int tasterneu;
+
+    //taster.mode(PullUp);
+    wait(.001);
+    while(1) {
+        tasterneu = taster;
+        if ((tasterneu==0) && (tasteralt==1))
+        {
+            counter++;
+        }
+        if(counter ==10)
+        {
+            myled=1;
+            wait(1);
+            counter=0;
+        }
+        else{
+            myled=0;
+        }
+        tasteralt = tasterneu;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 21 16:26:59 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96
\ No newline at end of file