Sharp IR Distance Sensor
Dependents: NavigationTest_ NavigationTest theRobotNEW theRobot ... more
Sharp.cpp
00001 #include "Sharp.h" 00002 #include "mbed.h" 00003 #include "math.h" 00004 00005 Sharp::Sharp( PinName voutPin ): 00006 vout(voutPin) 00007 { 00008 } 00009 00010 double Sharp::getIRDistance(void) 00011 { 00012 float dist = vout.read(); 00013 00014 return 37.115*dist*dist-73.021*dist+43.451; 00015 }
Generated on Wed Jul 13 2022 21:20:49 by 1.7.2