mbed GPIO Interrupt

Files at this revision

API Documentation at this revision

Comitter:
rkuo2000
Date:
Thu Oct 20 12:46:04 2016 +0000
Commit message:
mbed GPIO Interrupt

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7d78d405fa52 .gitignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Thu Oct 20 12:46:04 2016 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
diff -r 000000000000 -r 7d78d405fa52 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 20 12:46:04 2016 +0000
@@ -0,0 +1,13 @@
+// using NuMaker-PFM-NUC472 GPIO interrupt to set led on/off
+#include "mbed.h"
+
+InterruptIn button(D0); 
+DigitalOut  led(LED1);
+
+void flip() {
+    led = !led;
+}
+
+int main() {
+    button.rise(&flip); // if D0 is floating, then rgbled will be flashing
+}
diff -r 000000000000 -r 7d78d405fa52 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Thu Oct 20 12:46:04 2016 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#a6f3fd1a60d5df59246d7caf3f108c4d34e1808e