Andrea Corrado
/
HCSR04
K64F
Fork of HCSR04 by
Revision 8:25138f7b9309, committed 2017-01-13
- Comitter:
- andcor02
- Date:
- Fri Jan 13 14:48:25 2017 +0000
- Parent:
- 7:71da0dbf4400
- Commit message:
- K64F
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 |
diff -r 71da0dbf4400 -r 25138f7b9309 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jan 13 14:48:25 2017 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" +#include "hcsr04.h" + + +DigitalOut myled(LED1); +HCSR04 usensor(D8,D9); +unsigned int dist; +int main() +{ + + while(1) { + usensor.start(); + wait_ms(500); + dist=usensor.get_dist_cm(); + printf("\n\r cm:%ld",dist ); + + } +} \ No newline at end of file
diff -r 71da0dbf4400 -r 25138f7b9309 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jan 13 14:48:25 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/99b5ccf27215 \ No newline at end of file