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_6180XA1 mbed
Fork of HelloWorld_6180XA1 by
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.
main.cpp@4:ccd62fd7e137, 2015-09-17 (annotated)
- Committer:
- gallonm
- Date:
- Thu Sep 17 10:43:27 2015 +0200
- Revision:
- 4:ccd62fd7e137
- Parent:
- 3:ec91a30891d5
- Child:
- 5:fa65d931bd96
Test Init function and ReadID function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gallonm | 0:83c628a58feb | 1 | #include "mbed.h" |
gallonm | 4:ccd62fd7e137 | 2 | #include "vl6180x_class.h" |
gallonm | 0:83c628a58feb | 3 | |
gallonm | 4:ccd62fd7e137 | 4 | #include <string.h> |
gallonm | 4:ccd62fd7e137 | 5 | #include <stdlib.h> |
gallonm | 4:ccd62fd7e137 | 6 | #include <stdio.h> |
gallonm | 4:ccd62fd7e137 | 7 | |
gallonm | 4:ccd62fd7e137 | 8 | void OnErrLog(void){}; |
gallonm | 0:83c628a58feb | 9 | |
gallonm | 4:ccd62fd7e137 | 10 | int main() |
gallonm | 4:ccd62fd7e137 | 11 | { |
gallonm | 4:ccd62fd7e137 | 12 | DevI2C device_i2c(I2C_SDA, I2C_SCL); |
gallonm | 4:ccd62fd7e137 | 13 | VL6180X *sensor1 = new VL6180X(device_i2c); |
gallonm | 4:ccd62fd7e137 | 14 | |
gallonm | 4:ccd62fd7e137 | 15 | |
gallonm | 4:ccd62fd7e137 | 16 | sensor1->Init(); |
gallonm | 4:ccd62fd7e137 | 17 | sensor1->ReadID(); |
gallonm | 4:ccd62fd7e137 | 18 | } |