hugh b / Mbed 2 deprecated lpc4088

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
hughbellinger
Date:
Sun May 22 18:20:40 2022 +0000
Parent:
0:679afb0ef65b
Commit message:
intrpt;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sun May 22 18:15:44 2022 +0000
+++ b/main.cpp	Sun May 22 18:20:40 2022 +0000
@@ -1,12 +1,21 @@
 #include "mbed.h"
-
-DigitalOut myled(LED1);
-
+InterruptIn button(p5);
+DigitalOut led(LED1);
+DigitalOut flash(LED2);
+void flip(){
+   led=1;
+   wait(0.2);
+   led=0;
+   wait(0.2);
+   }
+ 
 int main() {
-    while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
-    }
+   button.rise(&flip);
+   while(1) {
+       flash = 1;
+       wait(0.2);
+       led = 0;
+       wait(0.2);
+   }
 }
+ 
\ No newline at end of file