Sweep a servo according to Proximity sensor measure

Dependencies:   Servo X_NUCLEO_6180XA1 mbed

Fork of HelloWorld_6180XA1 by ST

Revision:
36:0d4aa5b3234d
Parent:
35:8b4a5cc0fb1f
Child:
37:724632fff9c1
--- a/main.cpp	Tue Nov 24 16:06:03 2015 +0000
+++ b/main.cpp	Fri Nov 27 08:51:03 2015 +0000
@@ -20,8 +20,8 @@
    is not ready to be read from the corresponding register. So you need to wait
    for the result to be ready */
 
-#define VL6180X_I2C_SDA I2C_SDA
-#define VL6180X_I2C_SCL I2C_SCL
+#define VL6180X_I2C_SDA   D14 //I2C_SDA
+#define VL6180X_I2C_SCL   D15 //I2C_SCL
 
 #define RANGE   0
 #define ALS     1
@@ -145,7 +145,7 @@
 void IntContinousALSorRangeMeasure (DevI2C device_i2c) {
    int status; 	 
    /* creates the 6180XA1 expansion board singleton obj */
-   board=X_NUCLEO_6180XA1::Instance(&device_i2c, PB_0, PA_4, PA_5, PA_10);
+   board=X_NUCLEO_6180XA1::Instance(&device_i2c, A3, A2, D13, D2);
    DisplayMsg  ("INT");
    /* init the 6180XA1 expansion board with default values */
    status=board->InitBoard();
@@ -202,8 +202,10 @@
 =============================================================================*/
 int main()
 {   
+#ifdef USER_BUTTON
    InterruptIn stop_button (USER_BUTTON);
    stop_button.rise (&StopMeasureIRQ);	
+#endif   
    DevI2C device_i2c (VL6180X_I2C_SDA, VL6180X_I2C_SCL);     
 		
    IntContinousALSorRangeMeasure (device_i2c);  // start continous measures Interrupt based