Руслан Бредун / Mbed 2 deprecated STM32-MC_node

Dependencies:   mbed Watchdog stm32-sensor-base2

Revision:
17:0c8440955d31
Parent:
15:0f52feb640cf
Child:
18:025d9a617769
--- a/main.cpp	Mon Dec 14 14:13:35 2020 +0000
+++ b/main.cpp	Wed Jan 20 11:18:20 2021 +0000
@@ -132,16 +132,29 @@
         }
 
         Enc_left_data = Enc_left.getPosition();
+        wait_ms(3);
         Enc_right_data = Enc_right.getPosition();
+        wait_ms(3);
         
         Select1 = 1;
-        RS1.printf ("%d\r\n", Enc_left_data);//, Enc_right_data);
-        wait_ms(1);
+        RS1.printf ("%d\r\n", Enc_left_data), Enc_right_data);
+        wait_ms(3);
         Select1 = 0;
-
+        if(US2_data < 100){
+            Select2 = 1;
+            RS2.printf ("Left Obstacle\r\n");
+            wait_ms(200);
+            Select2 = 0;
+        }  
+        if(US3_data < 100){
+            Select2 = 1;
+            RS2.printf ("Right Obstacle\r\n");
+            wait_ms(200);
+            Select2 = 0;
+        }  
         if(sendFlag) {
             Select2 = 1;
-            RS2.printf ("%d_%d_%d_%d_%d_%d_%d_%3.1f_%3.1f\r\n", US1_data, US2_data, US3_data, IR1_data, IR2_data, Lift_IR1, Lift_IR2, temp_one_value, temp_two_value);  //,(int)((Vcc -24 ) * 5 + 50));
+            //RS2.printf ("%d_%d_%d_%d_%d_%d_%d_%3.1f_%3.1f\r\n", US1_data, US2_data, US3_data, IR1_data, IR2_data, Lift_IR1, Lift_IR2, temp_one_value, temp_two_value);  //,(int)((Vcc -24 ) * 5 + 50));
             wait_ms(5);
             sendFlag = false;
             Select2 = 0;