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.
Revision 0:f91b4b2acbe1, committed 2014-03-11
- Comitter:
- srsmitherman
- Date:
- Tue Mar 11 21:20:40 2014 +0000
- Commit message:
- Test Program for HCSR04
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HCSR04.lib Tue Mar 11 21:20:40 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/srsmitherman/code/HCSR04/#3ebde19131af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Mar 11 21:20:40 2014 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "HCSR04.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX,USBRX);
+HCSR04 ultra(p12,p11);
+
+float range=0;
+
+int main() {
+
+
+ pc.printf("Program Start\n");
+ while(1) {
+
+ ultra.startMeas();
+
+ wait(0.2);
+
+
+ if( ultra.getMeas(range) == RANGE_MEAS_VALID)
+ {
+ pc.printf("Range - %f\n\r", range);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Mar 11 21:20:40 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1 \ No newline at end of file