The first code

Dependencies:   mbed Motor

Revision:
7:987db6b7e1b8
Parent:
6:922f762e7f92
--- a/main.cpp	Thu Feb 19 15:46:03 2015 +0000
+++ b/main.cpp	Thu Feb 19 16:39:50 2015 +0000
@@ -27,18 +27,19 @@
 
     while(1) {
         time_count = 0;
-        while(time_count<300) {
+        while(time_count<600) {
 
 
 
             height = 193.125176919012*(pow(ain.read(),3))-353.927724612106*(pow(ain.read(),2))+218.749286479109*(ain.read())-23.2532105680997;
 
 
-
-            pc.printf("%f,",ain.read()); //this prints the voltage
-            pc.printf("%f,",height);
-            pc.printf("%f",t.read());
-            pc.printf("\n\r");
+            
+            //pc.printf("%f,",ain.read()); //this prints the voltage
+            pc.printf("%f",height);
+            //pc.printf("%f,",t.read());
+            //pc.printf("%d", time_count);
+            pc.printf("\n");
 
             err = Desired_distance-height;
             if(err>0) {
@@ -46,7 +47,7 @@
                 m.speed(0.7);
             } else if(err<0) {
 
-                m.speed(-0.7);
+                m.speed(-0.8);
 
             }