Skip to content

Commit 0f58ed3

Browse files
committed
Update README, add contribution guidelines
1 parent eb7daa8 commit 0f58ed3

File tree

12 files changed

+80
-39
lines changed

12 files changed

+80
-39
lines changed

CMakeLists.txt

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ project(VL53L1X_api
1616
VERSION 1.0.1
1717
DESCRIPTION "VL53L1X Raspberry Pi Pico/Pico W API")
1818

19-
2019
set(CMAKE_C_STANDARD 11)
2120
set(CMAKE_CXX_STANDARD 17)
2221

@@ -32,29 +31,6 @@ add_compile_options(-Wall
3231
-Wno-maybe-uninitialized
3332
)
3433

35-
add_subdirectory(VL53L1X_pico)
36-
37-
add_subdirectory(examples)
38-
39-
40-
#include(GNUInstallDirs)
41-
42-
#add_library(${PROJECT_NAME} SHARED
43-
# src/VL53L1X_api.c
44-
## src/VL53L1X_calibration.c
45-
# src/VL53L1_platform.c
46-
# )
47-
48-
#set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
49-
50-
#configure_file(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
51-
52-
#target_include_directories(${PROJECT_NAME} PRIVATE .)
53-
54-
#target_link_libraries(${PROJECT_NAME} pico_stdlib)
55-
56-
#install(TARGETS VL53L1X_api
57-
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
58-
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
34+
add_subdirectory(VL53L1X_pico_api)
5935

60-
#install(FILES ${CMAKE_BINARY_DIR}/VL53L1X_api.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
36+
add_subdirectory(examples)

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributions
2+
Thanks for your interest in contributing to this project. The contribution process involves several different scopes listed below.
3+
- Reporting bugs
4+
- Discussing the codebase
5+
- Submitting bug fixes
6+
- Proposing new features
7+
- Submitting new features
8+
- Becoming a maintainer
9+
10+
## Code Changes Happen With Pull Requests
11+
Please see the [Github Flow](https://guides.github.com/introduction/flow/index.html).
12+
13+
Pull requests are the best way to propose changes to the codebase. To contribute a pull request:
14+
15+
1. Fork the repository and create your branch from `main`.
16+
2. If you've added code, please consider adding tests.
17+
3. If you've modified existing code, please state the reason and update the documentation.
18+
4. Match the existing code style (roughly Google C++ Style Guide).
19+
5. Submit the pull request with the details of your feature/fix!
20+
21+
## Please report bugs using Github Issues
22+
This is the easiest way to track bugs and discuss fixes (e.g. if the code needs a patch, or if there's an issue with documentation, etc.). Report bugs by [opening an issue](https://github.com/briandk/transcriptase-atom/issues).
23+
24+
## Remember to write bug reports with detail, background, and an example of the issue
25+
Please provide enough information so that the error could be reproduced!
26+
27+
Ideally, the report should have:
28+
- Summary/background of the bug
29+
- Detailed information on your setup steps
30+
- Information to reproduce the bug
31+
- Expected output, and actual output
32+
- Any information about what you think might be going wrong
33+
34+
35+
## Code Style
36+
As above, please follow the Google C++ Style Guide when submitting changes.
37+
38+
## License
39+
By contributing, you acknowledge and agree that your contributions will be licensed under its MIT License.

README.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
11
# VL53L1X-C-API-Pico
2-
VL53L1X Time-of-Flight distance sensor API for the Raspberry Pi Pico/Pico W
2+
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/alex-mous/VL53L1X-C-API-Pico)
3+
![GitHub](https://img.shields.io/github/license/alex-mous/VL53L1X-C-API-Pico)
4+
![GitHub issues](https://img.shields.io/github/issues/alex-mous/VL53L1X-C-API-Pico)
5+
![GitHub contributors](https://img.shields.io/github/contributors/alex-mous/VL53L1X-C-API-Pico)
6+
## Description
37

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.
59

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:
823
```
924
mkdir build
1025
cd build
1126
cmake ..
1227
make
1328
```
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).
1541

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.
1743

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.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
add_library(VL53L1X_api VL53L1X_platform.c VL53L1X_api.c)
1+
add_library(VL53L1X_pico_api VL53L1X_platform.c VL53L1X_api.c)
22
add_library(VL53L1X_calibration VL53L1X_calibration.c VL53L1X_platform.c VL53L1X_api.c)
33

4-
target_include_directories(VL53L1X_api INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
4+
target_include_directories(VL53L1X_pico_api INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
55
target_include_directories(VL53L1X_calibration INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
66

7-
target_link_libraries(VL53L1X_api pico_stdlib hardware_i2c)
7+
target_link_libraries(VL53L1X_pico_api pico_stdlib hardware_i2c)
88
target_link_libraries(VL53L1X_calibration pico_stdlib hardware_i2c)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)