|
1 | 1 | # VL53L1X-C-API-Pico |
2 | | -VL53L1X Time-of-Flight distance sensor API for the Raspberry Pi Pico/Pico W |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +## Description |
3 | 7 |
|
4 | | -### Some features of this API are still in progress, but basic measurements work. |
| 8 | +A light, easy-to-use VL53L1X Time-of-Flight distance sensor driver/API in C/C++ for the Raspberry Pi Pico/Pico W. This project implements and extends the STMicroelectronics template driver for this sensor, specifically for Rasbperry Pi Pico/Pico W microcontrollers. |
5 | 9 |
|
6 | | -## Usage |
7 | | -See the examples for usage. To build the project, run the following: |
| 10 | +## Contributing |
| 11 | +Please see [CONTRIBUTING.md](CONTRIBUTING.md) |
| 12 | + |
| 13 | +## Future Features |
| 14 | +- C++ object-oriented library |
| 15 | +- Easy way to configure defaults passed into initialization functions |
| 16 | + |
| 17 | + |
| 18 | +# Usage |
| 19 | +To use this library in your own project, include the `VL53L1X_pico_api` directory in your CMake script (e.g. `add_subdirectory(VL53L1X_pico_api)`). Then, include the needed headers as specified below, and add `VL53L1X_pico_api` to the `target_link_libraries` for your project. Running `cmake` for your project should then include and compile this API as needed. |
| 20 | + |
| 21 | +# Examples |
| 22 | +To build the project, first clone the code and then run the following: |
8 | 23 | ``` |
9 | 24 | mkdir build |
10 | 25 | cd build |
11 | 26 | cmake .. |
12 | 27 | make |
13 | 28 | ``` |
14 | | -If you have a Pico W, append `-DPICO_BOARD=pico_w` to the `cmake` command. |
| 29 | +Note: if you have a Pico W, append `-DPICO_BOARD=pico_w` to the `cmake` command. |
| 30 | + |
| 31 | +This will build the example code. The resulting uf2 file in the `build/examples/continuous_measurement` can be uploaded to a Pico/Pico W. This example shows how to initialize and use the VL53L1X sensor to continously measure. |
| 32 | + |
| 33 | +# Documentation |
| 34 | +The header files all have extensive documentation on the purpose of each function, which can be supplemented by the *STMicroelectronics VL53L1X Ultra Lite Driver User Manual (UM2510)*. |
| 35 | + |
| 36 | +The three header files that can be included to use API functions are: |
| 37 | + - `VL53L1X_types.h`: This header file store types used in the API (status and results definitions, etc.). |
| 38 | + - `VL53L1X_api.h`: This header file contains all of the main API functions (initialization functions, getters and setters for registers, and functions to start/stop/read ranging). |
| 39 | + - `VL53L1X_calibration.h`: This header file contains functions to calibrate the VL53L1X sensor. |
| 40 | +In addition, the final header file, `VL53L1X_platform.h`, contains platform-specific functions and definitions (e.g. I2C setup and read/write for the Pico and Pico W). |
15 | 41 |
|
16 | | -The resulting uf2 files to upload to the Pico board reside in the build/examples directory. |
| 42 | +For most use cases, just including the first two header files should be sufficient. |
17 | 43 |
|
18 | | -## License |
19 | | -This API uses the `core` code from STMicroelectronics, and implements the platform for Raspberry Pi Pico/Pico W. The implemntation, under `platform`, is licensed under the MIT License. Code provided by STMicroelectronics (in `core`) is provided under the BSD 3-clause "New" or "Revised" License. |
| 44 | +# License |
| 45 | +This API extends, rewrites, and implements the VL53L1X driver code from STMicroelectronics. Code provided by STMicroelectronics (in `core`) is provided under the BSD 3-clause "New" or "Revised" License. All changes are licensed under the MIT License. |
0 commit comments