mjbogusz/vl53l0x-linux

The issue in Single Sensor Reads in line 55 and 56.

vijaypanchal opened this issue · 1 comments

The issue in Single Sensor Reads in line 55 and 56.
Error :

Scanning dependencies of target single
[ 8%] Building CXX object examples/CMakeFiles/single.dir/single.cpp.o
/home/debian/VL53L0X_TOF_Module/vl53l0x-linux-master/examples/single.cpp: In function ‘int main()’:
/home/debian/VL53L0X_TOF_Module/vl53l0x-linux-master/examples/single.cpp:63:31: error: ‘VcselPeriodPreRange’ is not a member of ‘VL53L0X’
sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodPreRange, 18);
^~~~~~~
/home/debian/VL53L0X_TOF_Module/vl53l0x-linux-master/examples/single.cpp:64:31: error: ‘VcselPeriodFinalRange’ is not a member of ‘VL53L0X’
sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodFinalRange, 14);
^~~~~~~
examples/CMakeFiles/single.dir/build.make:62: recipe for target 'examples/CMakeFiles/single.dir/single.cpp.o' failed
make[2]: *** [examples/CMakeFiles/single.dir/single.cpp.o] Error 1
CMakeFiles/Makefile2:89: recipe for target 'examples/CMakeFiles/single.dir/all' failed
make[1]: *** [examples/CMakeFiles/single.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

The enum was badly referenced but it only occured when compiling with LONG_RANGE defined, so I didn't notice that before.

The fix is to simply remove the VL53L0X:: prefix. Code in repo has been updated accordingly.

PS. I recommend inserting logs in code blocks (triple backticks) instead of a quote as some lines should be aligned to others and it's only possible with monospaced fonts.