ST / Mbed 2 deprecated HelloWorld_6180XA1

Dependencies:   X_NUCLEO_6180XA1 mbed

Fork of HelloWorld_6180XA1 by ST Expansion SW Team

X-Nucleo-6180XA1 Hello World Application

This application provides a simple example of usage of X_NUCLEO_6180XA1 library. It provides a measurement of:

  • Ambient Light (Lux),
  • Distance (millimeters) of an object in front of the on-board sensor.

The values are displayed on the Hyperterminal connected through COM port over USB.

Revision:
39:851cfabf7aa6
Parent:
37:724632fff9c1
Child:
40:204f84887d70
diff -r c0356f34112c -r 851cfabf7aa6 main.cpp
--- a/main.cpp	Thu Dec 03 11:06:39 2015 +0000
+++ b/main.cpp	Tue Feb 23 09:29:18 2016 +0000
@@ -137,10 +137,10 @@
 }
 
 
-void IntContinousALSorRangeMeasure (DevI2C device_i2c) {
+void IntContinousALSorRangeMeasure (DevI2C *device_i2c) {
    int status; 	 
    /* creates the 6180XA1 expansion board singleton obj */
-   board=X_NUCLEO_6180XA1::Instance(&device_i2c, A3, A2, D13, D2);
+   board=X_NUCLEO_6180XA1::Instance(device_i2c, A3, A2, D13, D2);
    DisplayMsg  ("INT");
    /* init the 6180XA1 expansion board with default values */
    status=board->InitBoard();
@@ -201,7 +201,7 @@
    InterruptIn stop_button (USER_BUTTON);
    stop_button.rise (&StopMeasureIRQ);	
 #endif   
-   DevI2C device_i2c (VL6180X_I2C_SDA, VL6180X_I2C_SCL);     
+   DevI2C *device_i2c =new DevI2C(VL6180X_I2C_SDA, VL6180X_I2C_SCL);     
 		
    IntContinousALSorRangeMeasure (device_i2c);  // start continous measures Interrupt based
 }