Colour sensors calibrated

Dependencies:   mbed-rtos mbed Servo QEI

Fork of ICRSEurobot13 by Thomas Branch

Files at this revision

API Documentation at this revision

Comitter:
twighk
Date:
Fri Apr 05 16:36:27 2013 +0000
Parent:
8:69bdf20cb525
Child:
10:1f0cf0182067
Commit message:
update to formula in cake sensor, as the 6cm point is not precice

Changed in this revision

Sensors/CakeSensor/CakeSensor.h Show annotated file Show diff for this revision Revisions of this file
--- 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