ICRS Eurobot 2013
Dependencies: mbed mbed-rtos Servo QEI
Diff: Sensors/CakeSensor/CakeSensor.h
- Revision:
- 9:960410a01e6b
- Parent:
- 8:69bdf20cb525
--- a/Sensors/CakeSensor/CakeSensor.h Thu Apr 04 19:37:05 2013 +0000 +++ b/Sensors/CakeSensor/CakeSensor.h Fri Apr 05 16:36:27 2013 +0000 @@ -13,8 +13,20 @@ float Distance(){return ain;} float Distanceincm(){ - float d = 5.5/(Distance()-0.13); + //float d = 5.5/(Distance()-0.13); + float d = 7.53/(Distance()-0.022); d = (d < 6 || d > 30)? -1:d; return d; } }; + /* + data = {{1/6,0.95},{1/9, 0.86}, {1/12, 0.65}, {1/15, 0.52}, {1/18, 0.44}, {1/21, 0.38}, {1/24, 0.33}, {1/27, 0.30}, {1/30, 0.28}} + Regress[data, {1, x}, x] + float d = 5.5/(Distance()-0.13); + + + data2 = {{1/9, 0.86}, {1/12, 0.65}, {1/15, 0.52}, {1/18, 0.44}, {1/21, 0.38}, {1/24, 0.33}, {1/27, 0.30}, {1/30, 0.28}} + Regress[data2, {1, x}, x] + float d = 7.53/(Distance()-0.022); + + */ \ No newline at end of file