Simple VL6180x demo for VL6180x Explorer shield with Nucleo F401 adapted from SparkFun example.
Dependents: VL6180X VL6180X_Explorer VL6180X_Explorer VL6180X ... more
Diff: VL6180x.h
- Revision:
- 4:ebaf8038c8ed
- Parent:
- 3:4a20f2102acf
- Child:
- 5:fa7d17a114d2
diff -r 4a20f2102acf -r ebaf8038c8ed VL6180x.h --- a/VL6180x.h Sun May 10 20:13:24 2015 +0000 +++ b/VL6180x.h Mon May 11 20:17:53 2015 +0000 @@ -237,7 +237,7 @@ * * @param sda SDA pin * @param sdl SCL pin -* @param addr addr of the I2C peripheral +* @param addr (7 bit) address of the I2C peripheral */ VL6180x(PinName sda, PinName scl, uint8_t addr); /** @@ -264,8 +264,6 @@ /** * Get ALS level in Lux * @param vl6180x_als_gain gain setting for sensor -* @param sdl SCL pin -* @param addr addr of the I2C peripheral * @returns light level in Lux */ float getAmbientLight(vl6180x_als_gain VL6180X_ALS_GAIN); @@ -273,6 +271,34 @@ * Load structure provided by the user with identification info * Structure example: * struct VL6180xIdentification +* @code +void printIdentification(struct VL6180xIdentification *temp){ + printf("Model ID = "); + printf("%d\n",temp->idModel); + + printf("Model Rev = "); + printf("%d",temp->idModelRevMajor); + printf("."); + printf("%d\n",temp->idModelRevMinor); + + printf("Module Rev = "); + printf("%d",temp->idModuleRevMajor); + printf("."); + printf("%d\n",temp->idModuleRevMinor); + + printf("Manufacture Date = "); + printf("%d",((temp->idDate >> 3) & 0x001F)); + printf("/"); + printf("%d",((temp->idDate >> 8) & 0x000F)); + printf("/1"); + printf("%d\n",((temp->idDate >> 12) & 0x000F)); + printf(" Phase: "); + printf("%d\n",(temp->idDate & 0x0007)); + + printf("Manufacture Time (s)= "); + printf("%d\n",(temp->idTime * 2)); + printf("\n\n"); +*@endcode */ void getIdentification(struct VL6180xIdentification *temp);