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.
main.cpp
- Committer:
- Match314
- Date:
- 2015-03-29
- Revision:
- 0:a982b6866f6c
File content as of revision 0:a982b6866f6c:
#include "mbed.h"
#include "hcsr04.h"
HCSR04 sensor(PB_8, PB_9);
Serial pc(USBTX, USBRX);
int main() {
pc.baud(921600);
while(1) {
sensor.start();
wait_ms(100);
pc.printf("%dcm\n", sensor.get_dist_cm());
}
}