Da wird ein Programm für die digitale Eingabe (z.B. drücken eines Tasters) gezeigt.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
besam
Date:
Wed Jan 15 00:44:13 2020 +0000
Commit message:
Letzte Version

Changed in this revision

Mbed_Dig_IN2.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 0da78fe0a0de Mbed_Dig_IN2.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Mbed_Dig_IN2.cpp	Wed Jan 15 00:44:13 2020 +0000
@@ -0,0 +1,15 @@
+//#define BUTTON1 p14  // push joystick pin
+//#define BUTTON1 A1  // Taster A1 bei online Simulator verwenden
+// Flash an LED while a DigitalIn is true
+#include "mbed.h"
+DigitalIn enable(BUTTON1);
+DigitalOut led(LED1);
+ 
+int main() {
+    while(1) {
+        if(enable) {
+            led = !led;
+        }
+        wait(0.25);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 0da78fe0a0de mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 15 00:44:13 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file