Ultrasonic sensor(HC-SR04) test for CORE-1000
Dependencies: HC_SR04_Ultrasonic_Library mbed
Revision 2:cb740a0e393e, committed 2017-02-03
- Comitter:
- odb
- Date:
- Fri Feb 03 08:06:24 2017 +0000
- Parent:
- 1:4a5586eb1765
- Commit message:
- CORE-1000 First
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Dec 04 08:04:55 2014 +0000
+++ b/main.cpp Fri Feb 03 08:06:24 2017 +0000
@@ -4,10 +4,10 @@
void dist(int distance)
{
//put code here to happen when the distance is changed
- printf("Distance changed to %dmm\r\n", distance);
+ printf("Distance %dmm\r\n", distance);
}
-ultrasonic mu(D8, D9, .1, 1, &dist); //Set the trigger pin to D8 and the echo pin to D9
+ultrasonic mu(PC_7, PA_9, .1, 1, &dist); //Set the trigger pin to D8 and the echo pin to D9
//have updates every .1 seconds and a timeout after 1
//second, and call dist when the distance changes