Julesnaps / Mbed 2 deprecated Linefollowproject

Dependencies:   m3pi mbed

Revision:
57:242d8eda740d
Parent:
55:2fb2ec1cab2a
Parent:
56:ea9a5cfbcc6b
Child:
58:852b91920a44
--- a/main.cpp	Wed Oct 12 09:30:51 2022 +0000
+++ b/main.cpp	Wed Oct 12 09:44:30 2022 +0000
@@ -127,36 +127,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);
     }
     
@@ -174,9 +178,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;
 }
@@ -208,10 +212,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
@@ -219,8 +220,6 @@
     {
         LED_Blink (1);      // signal in pit
         
-/* missing input to stop blink. */
-        
     }
 }