Giter Club home page Giter Club logo

vl53l0x's Introduction

TOF - VL53L0X Time of Flight distance sensor library

This code is based on the Pololu Arduino library (see LICENSE.txt) My aim with this project was to simplify that code and port it to Linux for use on boards like the Raspberry Pi. The problem with ST Micro's part and support software are that they designed their I2C interface specifically to rely on 'magic numbers' for initialization and publish a software library which requires adherance to restrictive licensing terms. By publishing this library, I hope to help more people use the sensor in more ways. The technology and low cost of the sensor make it a valuable addition to the IoT world, but ST Micro's attempt to obfuscate the interface and control the software goes against the open nature of the community.

This code puts the sensor into continous sample mode and allows selection between the default mode (30-800mm) and the long range mode (30-2000mm).

From my limited testing, it appears to give accurate results in the range 40-600mm. Beyond that and the results are less accurate and more prone to being interfered with by ambient light.

vl53l0x's People

Contributors

bitbank2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vl53l0x's Issues

initSensor returns 0

I can't get the demo code to work on my Raspberry Pi. I changed the main.c file already to i = tofInit(1, 0x29, 1). The application always exits with -1 because the function static int initSensor(int bLongRangeMode) returns a 0. Should the GPIO Pin be connected to the Raspberry?

the sensor and my i2c interface should be ok:
root@raspberrypi:~/VL53L0X# i2cdetect -y 1

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

How to change I2C Address in VL53L0X

AIM: Work with the 4-VL53L0X sensor using 1-I2C communication on BeagleBone Black.

I implement your contribution in BeagleBone Black for Single VL53L0X.

But in My Application, I use 4 VL53L0X sensors.

And the issue is all VL53L0X have the same Slave Address 0x29.

So, I think if I am able to change I2C Slave Address in VL53L0X then is Work.

Thank you.

VL53L0X sensor With BeagleBone Black

Aim: C program to get VL53L0X sensor data using I2C communication in BeagleBone Black.

I am working with BeagleBone Black to get data from VL53L0X. I need help to the Made a header file and source file for that.

I think @bitbank2 your Contribution is near to my solution. So you help me with how I implement in BeagleBone Black.

Issue:

  1. How to install the library.
  2. which method to compile the c code.
  3. how many changes I make in code. (like pin number, i2c bus.).

Thank you.

New library version

Hello,
I have done some modifications to the library.
Now it can be compiled as shared library (.so).
More, I have added two functions: tofStartReadDist start a new reading and soon return to caller; tofReadDistanceAsync read the distance without any initial waiting cycle. That is, the reading is non blocking.
Using these functions a caller program can do other processing in the reading interval required by the device. The caller first call tofStartReadDist, then is responsible to call tofReadDistanceAsync after the minimum required interval to complete the reading operation, 200 ms or more.
Attached there is also a simple test program.
Hoping this will be useful

Giandomenico De Sanctis

VL53L0X-nowait-sharedlib.zip

Hard to port to microcontrollers

Hi, this is not really a problem in the code if we only consider its original purpose, however, the use of the Linux write() function, especially in the context of the function writeRegList(), makes it very hard to port to non-Linux microcontrollers.

The difficulty arises from the fact that whenever one is using I2C libraries such as the ones provided inside of ASF (Atmel/Microchip) it is not possible to start a transaction without sending first the address, or, it is not possible to avoid (or hold) the sending of a NACK.
Unfortunately, I only observed such incompatibility after a few days of work.

In any case, thank you for your time and desire to help others.

sys/ioctl.h not found

the include paths are correct however ioctl.h is somehow not detected while compiling

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.