Giter Club home page Giter Club logo

vl53l1's Issues

[question] How to reduce memory usage when controlling multiple devices?

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?

VL53L1_Sat_HelloWorld.ino needs additional clear interrupt with ESP8266?

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:

  • StartMeasurement in the setup phase
  • ClearInterruptAndStartMeasurement at the end of the loop

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.

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.