Digitalout

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Reichi19
Date:
Thu Nov 15 17:10:25 2018 +0000
Commit message:
Digitalout

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 1639615b2652 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 15 17:10:25 2018 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+
+
+DigitalOut doMyled_1(LED1);
+DigitalOut doMyled_4(LED4);
+DigitalIn diJaUp(p15);
+BusOut doBlueLeds (LED1,LED2,LED3,LED4);
+
+uint8_t ledZustand;     // Zustandvar für eine LED
+
+void activate()
+{
+       
+    
+        wait(0.2);
+        doMyled_1 = 0;
+        wait(0.2);
+        doMyled_1 = 1;
+        wait(0.1);
+        doMyled_4 = !doMyled_4; // toogle
+        printf("Zustand von LED4 = %d/r/n", (int)doMyled_4); // Ausgabe in der HTerm Software
+}
+int main() { 
+    doMyled_1.write(1); 
+    ledZustand = doMyled_1.read();
+    //ledZustand = doMyled_1; // same as line above
+    
+    while(1) {
+        if(diJaUp)
+        {
+        activate();
+        }
+        else 
+        {
+        printf("Bitte Joystick UP druecken\r\n");
+        for(int i=0; i<16;i++)
+        {
+        doBlueLeds = i; 
+        //doMyled_1 = doMyled_4 = 0;    
+        wait(0.1);
+        }
+        doBlueLeds =0;
+        }
+    }
+}
diff -r 000000000000 -r 1639615b2652 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 15 17:10:25 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file