Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:a18f03867915
- Parent:
- 1:83a13087626e
--- a/main.cpp Fri Feb 19 14:38:05 2016 +0000
+++ b/main.cpp Mon Feb 22 05:26:50 2016 +0000
@@ -1,5 +1,11 @@
#include "mbed.h"
+#include "TextLCD.h"
+
Serial serialpc( USBTX,USBRX);
+TextLCD lcd(D0,D1,D2,D3,D4,D5);
+
+
+
InterruptIn Echo(D8);
DigitalOut Trigg(D9);
Timer timer;
@@ -31,9 +37,19 @@
}
dist=dist/58.0;
+ if(dist>5){
+ led=1;
+ }else{
+ led=0;
+ }
+ lcd.locate(0,0);
+ lcd.printf("la distancia es");
+ lcd.locate(0,1);
+ lcd.printf("%f cm",dist);
+ wait(.3);
- serialpc.printf("distancia %f cm\n",dist);
- wait(.2);
+
+
}
}
\ No newline at end of file