Julesnaps / Mbed 2 deprecated Linefollowproject

Dependencies:   m3pi mbed

Branch:
Uld minor fixes
Revision:
56:ea9a5cfbcc6b
Parent:
53:cef682f8684b
Child:
57:242d8eda740d
--- a/main.cpp	Wed Oct 12 09:27:42 2022 +0000
+++ b/main.cpp	Wed Oct 12 09:43:41 2022 +0000
@@ -131,36 +131,40 @@
   
     m3pi.cls();
     m3pi.locate(0,0);
-    m3pi.printf("DESTROY");
+    m3pi.print("DESTROY",8);
     m3pi.locate(0,1);
-    m3pi.printf("**CATS**");
+    m3pi.print("**CATS**",8);
     wait(5.0);
     
     m3pi.cls();
     m3pi.locate(0,0);
-    m3pi.printf("%4.4f ",m3pi.battery());
+    m3pi.print("%4.4f ",m3pi.battery());
     m3pi.locate(0,1);
-    m3pi.printf("%4.4f ",m3pi.pot_voltage());
+    m3pi.print("%4.4f ",m3pi.pot_voltage());
     wait(10.0);
     m3pi.cls();
     m3pi.locate(0,0);
-    m3pi.printf("ROBOT ON");
+    m3pi.print("ROBOT ON", 8);
     m3pi.locate(0,1);
-    m3pi.printf("TRACK!!");
+    m3pi.print("TRACK!!",7);
     wait(4.0);
     LCD_CountDown(3);
     m3pi.cls();
     m3pi.locate(0,0);
-    m3pi.printf("** GO **");
+    m3pi.print("** GO **",8);
     wait (1.0);
 }
     
 void LCD_CountDown(int num){
+    char str[8] = "**   **";
+
     for (int i=0; i<num; i++)
     {
        m3pi.cls();
        m3pi.locate(0,0); 
-       m3pi.printf("** %d **", i );
+       str[4] = i;
+
+       m3pi.print(str, i );
        wait(1.0);
     }
     
@@ -178,9 +182,9 @@
         LED_Control(1, 1);
         m3pi.cls();
         m3pi.locate(0,0);
-        m3pi.printf("Going to");
+        m3pi.print("Going to",8);
         m3pi.locate(0,1);
-        m3pi.printf("**PIT**");
+        m3pi.print("**PIT**",7);
     }
     return result;
 }
@@ -212,10 +216,7 @@
 
 void PS_PitStop(void)
 {
-    /* Testing alternative stop function
-    m3pi.left_motor(0);
-    m3pi.right_motor(0);
-    */
+    
     m3pi.stop();       // stop all engine
     
     // increase counter with one
@@ -223,8 +224,6 @@
     {
         LED_Blink (1);      // signal in pit
         
-/* missing input to stop blink. */
-        
     }
 }