A simple line following program

Dependencies:   mbed

Revision:
7:218e861ea777
Parent:
6:8f46c6ac55ca
--- a/main.cpp	Thu May 12 11:32:35 2011 +0000
+++ b/main.cpp	Thu May 12 11:34:15 2011 +0000
@@ -5,6 +5,11 @@
 
 int main() {
 
+    // Parameters that affect the performance
+    float speed = 0.2;
+    float correction = 0.1;   
+    float threshold = 0.5;
+
     m3pi.locate(0,1);
     m3pi.printf("Line Flw");
 
@@ -12,10 +17,6 @@
     
     m3pi.sensor_auto_calibrate();
     
-    float speed = 0.2;
-    float correction = 0.1;   
-    float threshold = 0.5;
-    
     while (1) {
 
         // -1.0 is far left, 1.0 is far right, 0.0 in the middle