Arduino library to support the VL53L0X Time-of-Flight and gesture-detection sensor.
The API provides simple distance measure, single swipe gesture detection, directional (left/right) swipe gesture detection and single tap gesture detection.
Params pointer to I2C instance
Params sensor shutdown pin
Params sensor interrupt pin
Params (optional) device address (0x29 by default)
VL53L0X_On: power on the sensor
VL53L0X_Off: power off the sensor
InitSensor: initialize the sensor with default values
Return 0 on Success, error code otherwise
Params specifies requested measure (range_single_shot_polling, range_continuous_polling, range_continuous_interrupt, range_continuous_polling_low_threshold, range_continuous_polling_high_threshold, range_continuous_polling_out_of_window, range_continuous_interrupt_low_threshold, range_continuous_interrupt_high_threshold, range_continuous_interrupt_out_of_window)
Params pointer to callback function. Must be not NULL in case of interrupt measure
Return 0 on Success, error code otherwise
Params specifies requested measure (range_single_shot_polling, range_continuous_polling, range_continuous_interrupt, range_continuous_polling_low_threshold, range_continuous_polling_high_threshold, range_continuous_polling_out_of_window, range_continuous_interrupt_low_threshold, range_continuous_interrupt_high_threshold, range_continuous_interrupt_out_of_window)
Params Data pointer to the MeasureData_t structure to read data in to
Return 0 on Success, error code otherwise
Params specifies requested measure (range_single_shot_polling, range_continuous_polling, range_continuous_interrupt, range_continuous_polling_low_threshold, range_continuous_polling_high_threshold, range_continuous_polling_out_of_window, range_continuous_interrupt_low_threshold, range_continuous_interrupt_high_threshold, range_continuous_interrupt_out_of_window)
Return 0 on Success, error code otherwise
Return 0 on Success, error code otherwise
Return 0 on Success, error code otherwise
Params pointer to range distance (value in millimeter)
Return 0 on Success, error code otherwise
Params The new i2c address (7bit)
Return 0 on Success, error code otherwise
You can find a complete description of the following functions in the API user manual (UM2039)
Params swipe threshold
Params Minimum duration of a swipe to be detected
Params Maximum duration of a swipe to be detected
Params pointer to Gesture_DIRSWIPE_1_Data_t structure
Return 0 on Success, error code otherwise
Params left range value in millimeter
Params right range value in millimeter
Params pointer to Gesture_DIRSWIPE_1_Data_t structure
Return One of these gestures code: GESTURES_SWIPE_LEFT_RIGHT, GESTURES_SWIPE_RIGHT_LEFT, GESTURES_NULL, GESTURES_DISCARDED_TOO_SLOW or GESTURES_DISCARDED_TOO_FAST
Params pointer to Gesture_SWIPE_1_Data_t structure
Return 0 on Success, error code otherwise
Params range value in millimeter
Params pointer to Gesture_SWIPE_1_Data_t structure
Return One of these gestures code: GESTURES_HAND_ENTERING, GESTURES_HAND_LEAVING, GESTURES_SINGLE_SWIPE or GESTURES_NULL, GESTURES_DISCARDED, GESTURES_DISCARDED_TOO_SLOW
Params pointer to Gesture_TAP_1_Data_t structure
Return 0 on Success, error code otherwise
Params range value in millimeter
Params pointer to Gesture_TAP_1_Data_t structure
Return One of these gestures code: GESTURES_SINGLE_TAP or GESTURES_NULL
Params range threshold
Params pointer to MotionData_t structure
Return 0 on Success, error code otherwise
Params range value in millimeter
Params pointer to MotionData_t structure
Return One of these gestures code: GESTURES_MOTION_NULL, GESTURES_MOTION_DOWN_STATE, GESTURES_MOTION_UP_STATE, GESTURES_MOTION_RAISE_UP or GESTURES_MOTION_DROP_DOWN
Note
The maximum detection distance is influenced by the color of the target and the indoor or outdoor situation due to absence or presence of external infrared. The detection range is between ~40cm and ~120cm. (see chapter 5 of the VL53L0X datasheet). If you need an higher accuracy (up to +200cm), you should implement your own function.
You can find the source files at
https://github.com/stm32duino/VL53L0X
The VL53L0X datasheet is available at
http://www.st.com/content/st_com/en/products/imaging-and-photonics-solutions/proximity-sensors/vl53l0x.html
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4