4.2 LED mittels Tastendruck ein- und ausschalten. (if/else)

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
stefan1691
Date:
Fri Feb 20 18:47:52 2015 +0000
Commit message:
4.2 LED mittels Tastendruck ein- und ausschalten. (if/else)

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	Fri Feb 20 18:47:52 2015 +0000
@@ -0,0 +1,18 @@
+/** 4.2 LED mittels Tastendruck ein- und ausschalten. (if/else)
+*/
+#include "mbed.h"
+
+DigitalIn b1( PTC9, PullUp );
+DigitalIn b2( PTC0, PullUp );
+DigitalOut led( D10 );
+
+int main()
+{
+    while (true)
+     {
+        if  ( b1 == 0 )
+            led = 1;
+        if  ( b2 == 0 )
+            led = 0;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Feb 20 18:47:52 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file