1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sunghunKim
Date:
Tue Mar 09 17:02:23 2021 +0000
Commit message:
1

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Mar 09 17:02:23 2021 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+InterruptIn button(p8);
+DigitalOut led(LED1);       
+DigitalOut flash(LED4);
+
+Timer timer;
+float duration;
+Serial pc(USBTX, USBRX); 
+void isr1() {
+  
+  duration = timer.read_ms();
+    timer.reset();
+    pc.printf("Pulso de: %f ms\n",  duration);
+  timer.start();
+}
+ 
+int main() {
+  button.rise(&isr1);                              
+  while(true) {
+    flash = !flash;
+    wait(0.2);
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 09 17:02:23 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file