Giter VIP home page Giter VIP logo

vl53l5cx's Introduction

VL53L5

A lightweight, header-only Arduino library for ST Microelectronics VL53L5 multizone Time-of-Flight ranging camera (get it here!) This library is designed to simplify the use of the sensor by helping you avoid illegal configurations; e.g., specifying an integration constant in continuous mode, or specifying too high a sampling frequency at a given resolution.

Quickstart

  1. Connect I2C in the usual way (SCL, SDA, 3.3V, GND)

  2. Connect INT and LPN to digital pins on your board, making sure the pin numbers agree with the pin numbers specified in the Basic test sketch.

  3. Flash the Basic test sketch onto your board.

  4. After a few seconds you should see the LED turn on solid.

  5. A few seconds after that, the LED should start blinking.

  6. Open the serial monitor to observer the rangefinder readings.

Supported platforms

I have tested this library on the following platforms:

Related projects

Known issues

Compiling on ESP32 with warnings set to More or All, you may get a memory warning that is treated as an error. Although ST claims to have fixed this problem, I was unable to get their code working on my ESP32. So I have opted to include the older code and set warnings to Default.

vl53l5cx's People

Contributors

simondlevy avatar sgnes avatar fl3tching101 avatar

Stargazers

Jiangxiang Wang  avatar Niklas Leinz avatar CJ Deisler avatar ZealerLu avatar  avatar lostmj avatar  avatar  avatar Mario Becker avatar Aniel Shri avatar Alvaro Hermida avatar Arev Imer avatar Jim M avatar Jonathan Dumaresq avatar Medad Newman avatar Alex Bulgakov avatar Rik van der Heijden avatar Daniel Mironov avatar Terry Phillips avatar  avatar  avatar Daniel Honies avatar Tomato1107 avatar Hideaki Tai avatar Kris Winer avatar Joël Schulz-Andres avatar Zain  avatar

Watchers

Mark Grosen avatar James Cloos avatar Mike Rankin avatar Alvaro Hermida avatar Kris Winer avatar  avatar  avatar Terry Phillips avatar  avatar

vl53l5cx's Issues

Last resolution.ino doesn't work on a Teensy4.0 ?

Hi,

First of all , thanks a lot for your work !
I am testing your dev resolution.ino (update last night) for a resolution 8x8 on a Teensy4.0 and it doesn't work. Nothing in the serial and the function vl53l5cx_check_data_ready(&_dev, &is_ready) in the sensor.isReady() line block.

I have last version of all framework and library and i use PlatformIO (but i don't think it is the problem).
When i test, *p_ready is never to 1, it keep 0, so function vl53l5cx_check_data_ready engage an infinite loop because the following condition in never true :
if((p_dev->temp_buffer[0] != p_dev->streamcount)
&& (p_dev->temp_buffer[0] != (uint8_t)255)
&& (p_dev->temp_buffer[1] == (uint8_t)0x5)
&& ((p_dev->temp_buffer[2] & (uint8_t)0x5) == (uint8_t)0x5)
&& ((p_dev->temp_buffer[3] & (uint8_t)0x10) ==(uint8_t)0x10)
)

More precisely those conditions is never true :
p_dev->temp_buffer[0] != p_dev->streamcount
p_dev->temp_buffer[0] != (uint8_t)255
p_dev->temp_buffer[3] & (uint8_t)0x10) == (uint8_t)0x10

Is there a buffer trouble ?

Use of float_t in ST code prevents compiling for Arduino Pro Mini

On Ubuntu 20.04, Arduino 1.8.13, with the library installed via downloading the zip file and importing it from
Sketch -> Include Library -> Import ZIP library...

The test code is basically just the initialization from the autonomous ranging example.

/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp: In function 'uint8_t vl53l5cx_motion_indicator_set_distance_motion(VL53L5CX_Configuration*, VL53L5CX_Motion_Configuration*, uint16_t, uint16_t)':
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:105:2: error: 'float_t' was not declared in this scope
float_t tmp;
^~~~~~~
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:105:2: note: suggested alternative: 'float'
float_t tmp;
^~~~~~~
float
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:115:3: error: 'tmp' was not declared in this scope
tmp = (float_t)((((float_t)distance_min_mm/(float_t)37.5348)
^~~
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:115:30: error: expected ')' before 'distance_min_mm'
tmp = (float_t)((((float_t)distance_min_mm/(float_t)37.5348)
^~~~~~~~~~~~~~~
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:116:63: error: expected ')' before ';' token
-(float_t)4.0)*(float_t)2048.5);
^
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:116:63: error: expected ')' before ';' token
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:119:46: error: expected ')' before 'distance_max_mm'
tmp = (float_t)((((((float_t)distance_max_mm-
^~~~~~~~~~~~~~~
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:121:39: error: expected ')' before ';' token
/((float_t)15.01392))+(float_t)0.5);
^
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:121:39: error: expected ')' before ';' token
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:121:39: error: expected ')' before ';' token
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_plugin_motion_indicator.cpp:121:39: error: expected ')' before ';' token

Execution getting stuck during init on STM32 with stm32duino

Hi,

thank you very much for publishing your library for this sensor.

unfortunately on my STM32 (Nucleo F446RE) this code get stuck up during the initialization, as the sensor does not return the expected value in poll_for_answer, here is a permalink to the corresponding line in code: https://github.com/simondlevy/VL53L5/blob/fa743d1c319c5fd53562447cf11af5ac3199ccfd/src/vl53l5cx_api.cpp#L445

The issue is described here on the ST Community forum too:
https://community.st.com/s/question/0D53W000010uFcTSAU/vl53l5cx-driver-vl53l5cxinit-fails
The error is attributed to too small RX and TX Buffers. I can see that you have a Fix for some STM32 boards implemented, and have defined ARDUINO_ARCH_STM32, but this does not change the behavior. Are you aware of other issues with STM32 boards?

I am using PlatformIO with the stm32duino, did you use the STM32 for your Ladybug tests too, or did you use Arduino_STM32?

Constant arrays for firmware in the ST code prevent compilation for Arduino Pro Mini

Arduino Pro Mini, Ubuntu 20.04, Arduino IDE 1.8.13.

In file included from /home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_api.cpp:4:0:
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_buffers.h:21587:1: error: too many initializers for 'const uint8_t [0] {aka const unsigned char [0]}'
};
^
/home/ams/Arduino/libraries/VL53L5-main/src/st/vl53l5cx_buffers.h:21587:1: sorry, unimplemented: non-trivial designated initializers not supported

(Same message repeated over a hundred times...)

That line number is the end of an attempt to initialize a very large array with the VL53L5 firmware (according to the comments, anyway). Explicitly setting the size of the array gets rid of the "Sorry, unimplemented" message, but not the "too many initializers" message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.