one lap kind of works

Dependencies:   FatFileSystem MSCFileSystem btbee m3pi_ng mbed

Fork of Robot by IESS

Files at this revision

API Documentation at this revision

Comitter:
charwhit
Date:
Mon Jun 01 08:10:10 2015 +0000
Parent:
12:0422156f83f6
Child:
14:5b3cc7741bdf
Commit message:
Reading off file and sweep working

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Jun 01 08:06:02 2015 +0000
+++ b/main.cpp	Mon Jun 01 08:10:10 2015 +0000
@@ -207,19 +207,17 @@
 
 
         current_pos = robot.line_position();
-       /*if (fgets(sweepValue, 100, sweep) != NULL){
-            if (import < sweepData.size())*/
-                f = 19.8/20 * t + .2;
-                newSetPoint = A*sin(2*PI*f*t);
-                proportional =  newSetPoint + current_pos;
+       if (fgets(sweepValue, 100, sweep) != NULL){
+            
+                //f = 19.8/20 * t + .2;
+                //newSetPoint = A*sin(2*PI*f*t);
+                proportional =  atof(sweepValue) + current_pos;
                 
-            /*else
-                break;*/
-        /*}
+        }
         else{
             robot.printf("Try Again");
             break;
-        }*/
+        }
         
 
         derivative = current_pos - previous_pos;