Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_6180XA1 SunTracker_BLE Servo_6180XA1 BLE_HR_Light ... more
Fork of X_NUCLEO_6180XA1 by
X-NUCLEO-6180XA1 Proximity and Ambient Light Sensor Expansion Board Firmware Package
Introduction
This firmware package includes Components Device Drivers and Board Support Package for STMicroelectronics' X-NUCLEO-6180XA1 Proximity and ambient light sensor expansion board based on VL6180X.
Firmware Library
Class X_NUCLEO_6180XA1 is intended to represent the Proximity and ambient light sensor expansion board with the same name.
The expansion board is providing the support of the following components:
- on-board VL6180X proximity and ambient light sensor,
- up to three additional VL6180X Satellites,
- on-board 4-digit display
It is intentionally implemented as a singleton because only one X-NUCLEO-VL6180XA1 at a time might be deployed in a HW component stack. In order to get the singleton instance you have to call class method `Instance()`, e.g.:
// Sensors expansion board singleton instance static X_NUCLEO_6180XA1 *6180X_expansion_board = X_NUCLEO_6180XA1::Instance();
Arduino Connector Compatibility Warning
Using the X-NUCLEO-6180XA1 expansion board with the NUCLEO-F429ZI requires adopting the following patch:
- to remove R46 resistor connected to
A3pin; - to solder R47 resistor connected to
A5pin.
Alternatively, you can route the Nucleo board’s A5 pin directly to the expansion board’s A3 pin with a wire.
In case you patch your expansion board or route the pin, the interrupt signal for the front sensor will be driven on A5 pin rather than on A3 pin.
Example Applications
Diff: Components/VL6180X/vl6180x_class.h
- Revision:
- 38:18abb7f7dcb2
- Parent:
- 35:407b0b127eb8
- Child:
- 41:2e00362bdb8e
--- a/Components/VL6180X/vl6180x_class.h Fri Nov 27 08:47:30 2015 +0000
+++ b/Components/VL6180X/vl6180x_class.h Thu Dec 03 09:45:40 2015 +0000
@@ -93,7 +93,7 @@
/* Classes -------------------------------------------------------------------*/
/** Class representing a VL6180X sensor component
*/
-class VL6180X : public RangeSensor, public LightSensor
+class VL6180X : public RangeSensor, public LightSensor
{
public:
/** Constructor 1
@@ -276,7 +276,7 @@
* @param void
* @return 0 on success, @a #CALIBRATION_WARNING if failed
*/
- int Init()
+ virtual int Init()
{
return VL6180x_InitData(Device);
}
@@ -434,7 +434,7 @@
* @param pRange_mm Pointer to range distance
* @return 0 on success
*/
- int GetRange(int32_t *piData)
+ virtual int GetRange(int32_t *piData)
{
return VL6180x_RangeGetResult(Device, piData);
}
@@ -1035,7 +1035,7 @@
* @param *piData The pointer to variable to write in the measure in Lux
* @return 0 On success
*/
- int GetLight(uint32_t *piData)
+ virtual int GetLight(uint32_t *piData)
{
return VL6180x_AlsGetLux(Device, piData);
}
@@ -1132,7 +1132,7 @@
int _DMax_InitData(VL6180xDev_t dev);
/* Read function of the ID device */
- int ReadID();
+ virtual int ReadID();
/* Write and read functions from I2C */
int VL6180x_WrByte(VL6180xDev_t dev, uint16_t index, uint8_t data);

X-NUCLEO-6180XA1 Proximity and Ambient Light Sensor