Works with the parallax ping sensor. Uses a timer and interrupts to get the time and calculate the distance

Dependents:   CatPot_2v00_T_Sub CatPot_2v10_T_Sub CatPot_2v20_T_Sub CatPot_2v30_T_Sub

Fork of Ping by Joel Rosiene

Files at this revision

API Documentation at this revision

Comitter:
lilac0112_1
Date:
Thu Mar 10 14:10:44 2016 +0000
Parent:
2:e252ca27589b
Commit message:
changed usw trig time

Changed in this revision

Ping.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Ping.cpp	Thu Dec 31 05:16:15 2015 +0000
+++ b/Ping.cpp	Thu Mar 10 14:10:44 2016 +0000
@@ -32,9 +32,9 @@
      
      _cmd.output();
      _cmd.write(0);  // see the ping documentation http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/28015-PING-v1.6.pdf
-     wait_us(3);
+     wait_us(1);
      _cmd.write(1);
-     wait_us(3);
+     wait_us(11);
      _cmd.write(0);
      _cmd.input();