Tutorial for first mbed project

Dependencies:   mbed lib_workshop_2019

Revision:
4:bf5caf4c0c88
Parent:
3:a0e37b8918ac
Child:
5:d99659a45cab
--- a/main.cpp	Wed Oct 23 14:01:59 2019 +0000
+++ b/main.cpp	Wed Oct 23 19:25:12 2019 +0000
@@ -4,11 +4,11 @@
 #include "test_us.h"
 #include "test_compass.h"
 #include "test_cny.h"
+#include "test_motor.h"
 
 #include "pin_connexions.h"
 
 
-
 Serial      pc      (PA_2, PA_3, 115200);
 
 int main() {
@@ -16,8 +16,11 @@
     ft_print_test_menu(pc);
     user_choice = ft_get_user_choice(pc);
     
+    
+    /* Main loop */
     while(1)
     {
+        /* Which component to test ? */
         switch (user_choice) 
         {
         case ULTRASONIC :
@@ -62,20 +65,12 @@
             break;
         
         case LEFT_MOTOR : 
-            do
-            {
-                ft_print_to_be_imp(pc);
-            } while (!pc.readable());
-            pc.printf("\n");
+            ft_test_motor(Pwm_MG,DIR_1G,DIR_2G,pc);
             user_choice = ft_get_user_choice(pc);
             break;
             
         case RIGHT_MOTOR: 
-            do
-            {
-                ft_print_to_be_imp(pc);
-            } while (!pc.readable());
-            pc.printf("\n");
+            ft_test_motor(Pwm_MD,DIR_1D,DIR_2D,pc);
             user_choice = ft_get_user_choice(pc);
             break;