FET10 if else Abfrage

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
wango
Date:
Sat Sep 22 18:27:51 2012 +0000
Commit message:
2 LED with else if command switch to on or off

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 4aa802fdf78e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Sep 22 18:27:51 2012 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+DigitalIn taster(p20); // Deklaration des tasters auf pin 10
+DigitalIn taster2(p19);
+
+DigitalOut LED (LED1);
+DigitalOut Led2(LED2);
+DigitalOut Led4 (LED4);
+Serial pc(USBTX, USBRX); // Serielle Schnittstelle
+ 
+int main()
+ {
+    while(1) 
+    {
+    
+    if (taster==1){
+    LED=1;}
+    else{
+    LED=0;
+    }
+    if(taster2==1){
+    Led2=1;
+    }
+    else{
+    Led2=0;
+    }
+    if(taster==1&&taster2==1)
+    {
+    Led4=1;
+    }
+    else
+    {
+    Led4=0;
+    }
+  }}
diff -r 000000000000 -r 4aa802fdf78e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Sep 22 18:27:51 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc
\ No newline at end of file