basic code

Dependencies:   FatFileSystem MSCFileSystem btbee m3pi_ng mbed

Fork of Robot by IESS

Revision:
8:7d491b51665e
Parent:
7:99d09e88924b
Child:
9:bd2f012e2f57
--- a/main.cpp	Wed May 27 12:02:28 2015 +0000
+++ b/main.cpp	Wed May 27 13:36:42 2015 +0000
@@ -39,7 +39,7 @@
     float average_time = 0.0;
     int y =1;
     int count = 0;
-    int paramChange[3];
+    float paramChange[3];
 
     char arr_read[30]; // this should be long enough to store any reply coming in over bt.
     int  chars_read;
@@ -72,7 +72,7 @@
         //else if (m3pi_IN [0] == 0)
         //{break;}
 
-        else if( x[0] > 300 && x[2]>300 && x[4]>300) {
+        if( x[0] > 300 && x[2]>300 && x[4]>300) {
             if (lap == 0) {
                 while( x[0]> 300 && x[4] > 300) {
                     robot.calibrated_sensor(x);
@@ -95,7 +95,7 @@
                 while (count < 3){
                     //btbee.printf("Input parameter\n");
                     btbee.read_line(arr_read, 30, &chars_read);
-                    paramChange[count] = atoi(arr_read);
+                    paramChange[count] = atof(arr_read);
                     //btbee.printf("%d", arr_read);
                     count++;
                 }