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

Revision:
3:b9760df91b3d
Parent:
2:e252ca27589b
--- 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();