Robot team project

Dependencies:   QEI Motordriver ros_lib_melodic

Revision:
3:a3144a45f44c
Parent:
2:c537f1ebad7b
Child:
4:cb50c6fa340b
--- a/sensor/Sensor.cpp	Tue Oct 22 10:05:12 2019 +0000
+++ b/sensor/Sensor.cpp	Tue Oct 22 10:09:05 2019 +0000
@@ -7,6 +7,10 @@
 : i2c(sda, scl), SHDN(shdn) 
 {
     addr = DEFAULT_DEVICE_ADDRESS << 1; 
+    
+    // At the beginning, turn off the device
+    turnOff();
+    wait_ms(0.5);
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -14,6 +18,9 @@
 ///////////////////////////////////////////////////////////////////
 int Sensor::init()
 {
+    // Turn on the device
+    turnOn();
+    
     char reset;
 
     // check to see has it be Initialised already