stm32duino / VL53L0X

Arduino library to support the VL53L0X Time-of-Flight and gesture-detection sensor
16 stars 13 forks source link

Is it possible to modify this library for arduino boards too? #6

Closed Gomezzzzz closed 6 years ago

cparata commented 6 years ago

Which Arduino board do you want to use? Actually, the library should work also with whatever Arduino board. You just need to adjust the sample sketch for your use case.

Gomezzzzz commented 6 years ago

I use Arduino Nano and sometimes Mega.

cparata commented 6 years ago

Ok, thanks. What is instead the board with VL53L0X component that you are using? Is the X-NUCLEO-53L0A1 shield?

Gomezzzzz commented 6 years ago

Oh, I think it's Chinese noname. :( vl53l0x-flight-tof-breakout-940nm-gy-vl53l0xv2 vl53l0x-flight-tof-breakout-940nm-gy-vl53l0xv2_1

cparata commented 6 years ago

Ok, I fixed an issue on the library (UNUSED macro was not defined for Arduino boards). Now you can try to run the Arduino_Nano_VL53L0X_DataLogTerminal sketch attached to this post but you need to adjust the Wire and the pins XSHUT, GPIO1 definition. I suppose that Wire instance is "Wire" of the Nano, XSHUT is pin 5 of the Nano and GPIO1 is pin 6 of the Nano. So you need to physically connect these pins to the Nano using some wires. Let me know if it works on your side. Unfortunately I do not have an Arduino Nano and your chinese board of VL53L0X to test your setup. Regards, Carlo Arduino_Nano_VL53L0X_DataLogTerminal.txt

Gomezzzzz commented 6 years ago

Wow! Thank you so much! It's working now!

cparata commented 6 years ago

Great! I will close this issue and I will create a new tag of the library with this patch and some tips to get the library working also with Arduino boards.