abc

Dependencies:   mbed pixy pixy_test

Fork of pixy_test by ese519

Files at this revision

API Documentation at this revision

Comitter:
jfields
Date:
Tue Nov 24 01:26:57 2015 +0000
Parent:
1:5302a23c97c4
Commit message:
abc

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5302a23c97c4 -r 1354ce60c0b9 main.cpp
--- a/main.cpp	Tue Nov 24 01:06:04 2015 +0000
+++ b/main.cpp	Tue Nov 24 01:26:57 2015 +0000
@@ -41,9 +41,9 @@
     
     // output results
     if (num_readings > 30) {
-        double average_y = total_y/num_readings;
-        double result = -42*average_y + 327;
-        pc.printf("y = %d, num_readings = %d, average = %d, mL = %d\r\n", y, num_readings, average_y, result);
+        float average_y = (float)total_y/num_readings;
+        float result = -2.0794*average_y + 351.97;
+        pc.printf("y = %d, num_readings = %d, average = %f, mL = %f\r\n", y, num_readings, average_y, result);
         
         // reset vars
         num_readings = 0;