Library to use the ultrasonic sensor

Dependents:   test_ultrasonic AEB Car_Simulator

Revision:
2:12da800fd10a
Parent:
1:b3518845e71a
Child:
3:9b06e5793b8b
diff -r b3518845e71a -r 12da800fd10a Ultrasonic.cpp
--- a/Ultrasonic.cpp	Sat Jun 04 18:13:44 2016 +0000
+++ b/Ultrasonic.cpp	Sat Jun 04 18:23:50 2016 +0000
@@ -34,10 +34,10 @@
 
 void trig()
 {
+    timeout.attach(&timeout_err, 0.05);
     trigger = 1;
     wait_us(10);
     trigger = 0;
-    timeout.attach(&timeout_err, 0.05);
 }