code for the speed robot

Dependencies:   MPU6050-DMP mbed PololuQTRSensors vl53l0x

Revision:
5:bb0763ae79ff
Parent:
4:538efc40388e
Child:
6:a635edf31d8b
--- a/tof.h	Mon Sep 30 10:33:12 2019 +0000
+++ b/tof.h	Mon Sep 30 10:37:06 2019 +0000
@@ -3,31 +3,18 @@
     DigitalOut xshut1(XSHUT_pin1);
     DigitalOut xshut2(XSHUT_pin2);
     DigitalOut xshut3(XSHUT_pin3);
-    xshut1 = 0;
-    xshut2 = 0;
-    xshut3 = 0;
 
-    xshut1 = 0;
-    xshut2 = 0;
-    xshut3 = 1;
+    DigitalIn xshut3_(XSHUT_pin3);
     wait(0.01);
     Sensor3.setAddress(Sensor3_newAddress);
 
-    xshut1 = 0;
-    xshut2 = 1;
-    xshut3 = 0;
+    DigitalIn xshut2_(XSHUT_pin2);
     wait(0.01);
     Sensor2.setAddress(Sensor2_newAddress);
 
-    xshut1 = 1;
-    xshut2 = 0;
-    xshut3 = 0;
+    DigitalIn xshut1_(XSHUT_pin1);
     wait(0.01);
     Sensor1.setAddress(Sensor1_newAddress);
-
-    xshut1 = 0;
-    xshut2 = 0;
-    xshut3 = 0;
     
     if (Sensor1.init())
     {