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
Revision 2:e252ca27589b, committed 2015-12-31
- Comitter:
- lilac0112_1
- Date:
- Thu Dec 31 05:16:15 2015 +0000
- Parent:
- 1:6996f66161d7
- Child:
- 3:b9760df91b3d
- Commit message:
Changed in this revision
Ping.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Ping.cpp Sat Mar 12 22:32:06 2011 +0000 +++ b/Ping.cpp Thu Dec 31 05:16:15 2015 +0000 @@ -48,7 +48,7 @@ // -1 means not valid. { if(_Valid && ~_Busy) - return ((_Time*_SPEED_OF_SOUND_CM)/1000); + return ((_Time*_SPEED_OF_SOUND_CM)/1000/2); else return -1; } \ No newline at end of file