![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Sensor US
main.cpp
- Committer:
- oscarvzfz
- Date:
- 2015-11-23
- Revision:
- 0:75937df46708
File content as of revision 0:75937df46708:
#include "mbed.h" #include "HCSR04.h" Serial pc(USBTX,USBRX); HCSR04 rangeFinder(p14,p13); float range; int main() { pc.baud(9600); while(1) { rangeFinder.startMeas(); wait(0.1); rangeFinder.getMeas(range); printf("range = %f\n\r", range); } }