stm32duino / vl53l1 Goto Github PK
View Code? Open in Web Editor NEWArduino library to support the VL53L1 Time-of-Flight ranging sensor with advanced multi-zone and multi-object detection
License: BSD 3-Clause "New" or "Revised" License
Arduino library to support the VL53L1 Time-of-Flight ranging sensor with advanced multi-zone and multi-object detection
License: BSD 3-Clause "New" or "Revised" License
I am using this library to control 4 VL53L1 devices. For this I defined 4 objects of the class VL53L1
. Unfortunately each object uses 9kB dynamic memory. This meets my expectations from the information given in the user manual UM2133 (8kB).
I am compiling with xtensa-lx106-elf-g++ (GCC) 4.8.2 and -Os
.
I defined VL53L1_MAX_RANGE_RESULTS
to 1.
These 4 objects use nearly half of the RAM available on the ESP8266 I use.
Do you have any recommendations on how to safe some memory? I only need simple range measurement data from each device.
Is it a good idea to use only one object and switch between the devices? What are the drawbacks?
Using the current version (bdd6387) of the VL53L1_Sat_HelloWorld.ino
example I do not get any data from the sensor unless I add an additional clear interrupt.
The program execution is stuck in this loop:
do
{
status = sensor_vl53l1_sat.VL53L1_GetMeasurementDataReady(&NewDataReady);
} while (!NewDataReady);
status
is always 0 and !NewDataReady == true
.
But if instead I modify the end of the setup procedure as follows:
- sensor_vl53l1_sat.VL53L1_StartMeasurement();
+ sensor_vl53l1_sat.VL53L1_ClearInterruptAndStartMeasurement();
Then everything works as expected: I get correct data.
But according to the user manual UM2133 rev 6 fig. 6 the original procedure in the code is correct:
So I wonder, where is the error?
I have this issue only with an ESP8266 (NodeMCU board). I also tested it with a Nucleo Board:
start code at this line | Nucleo F401RE | NodeMCU |
---|---|---|
VL53L1_StartMeasurement() |
works as expected ✔️ | no data ❌ |
VL53L1_ClearInterruptAndStartMeasurement() |
works as expected ✔️ | works as expected ✔️ |
In order to use it with the NodeMCU I obviously had to use a different pin for XSDN_I
.
I know that the VL53L1_Sat_HelloWorld.ino
is designed for a Nucleo Board. But due to the abstraction by the Arduino Library I would have expected to work for both boards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.