View previous topic :: View next topic |
Author |
Message |
beaker404
Joined: 24 Jul 2012 Posts: 163
|
VL53L0X |
Posted: Wed Jul 25, 2018 8:58 am |
|
|
Looking at using the VL53L0X for a range project. Looks promising but seems complex to get simple range data out of. I have seen code posted, and a thread that talked about getting it up and running on a 18F chip. Anyone done more work with getting the VL53L0X to work with CCS and a PIC?
18F platform
MPLAB V 8.91.00.00
CCS PCM C Compiler, Version 5.064, xxxxx
Windows 10 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Wed Jul 25, 2018 11:40 am |
|
|
Go here:
<https://github.com/LILCMU/vl53l0x-ccs> |
|
|
beaker404
Joined: 24 Jul 2012 Posts: 163
|
|
Posted: Thu Jul 26, 2018 1:36 pm |
|
|
yes, I saw that link and looked it over, was hoping where was a simpler way to do an evaluation on the sensor, par for the course, code like this I run across nowhere near builds for me. this is no exception. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Thu Jul 26, 2018 1:49 pm |
|
|
While I haven't downloaded the datasheet for the sensor, it does appear to be rather complex compared to say an RTC device like the DS1307. However, the link supplies code that apparently works, so 99% of the work is already done for you !
As for 'evaluating' the device, you'll have to decide how to proceed as 'we' have no idea what your requirements are. I might only need functions 2,4,5 whereas you need functions 1, 5 and 22-25, so my evaluation would be meaningless to you.
Time to put a pot of coffee on, build some hardware, cut code, compile and test !
Jay |
|
|
beaker404
Joined: 24 Jul 2012 Posts: 163
|
|
Posted: Thu Jul 26, 2018 2:09 pm |
|
|
Agreed, I have not outlined a plan that allows anyone to help, I am trying to figure out how much of the example has to be in play to make a minimal measurement.
I am getting an error for the i2c_start() call saying a comma is needed. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Thu Jul 26, 2018 2:11 pm |
|
|
It is not a simple sensor. No just read a number and you have range. You have to do the calibration, and use the values from this to calculate the readings. That port is about as simple as it is likely to get, though it could be inproved by switching slightly more to CCS functions. |
|
|
elcrcp
Joined: 11 Mar 2016 Posts: 62 Location: izmir / Turkey
|
|
Posted: Fri Jul 27, 2018 1:04 pm |
|
|
I've used that sensor and the library and it works. That sensor indeed requires a lot of initialization lines and takes big amount of program memory, also needs some alterations on library with 16F series but works fine with 18F series.
Also take note of the summary section of library Quote: | The library targets the PIC16F886 but it should work with any other PICs with more than 4K flash memory, including PIC18s and PIC24s. |
_________________ There is nothing you can't do if you try |
|
|
|