2020-09-08 03:03 AM
Hello,
I am using a PNUCLEO VL6180X and I would like to drive my LED from the GPIO1 interrupt output only this output as shown in the diagrams above is always at 1 and it goes to 0 only for a few nanoseconds; I would like to have an interrupt signal only when I bring my hand closer to the sensor, I would like it to send a 1 to the LED when there is a target and a 0 when there is nothing.
Here are some images on the oscilloscope with the target and without the target
Solved! Go to Solution.
2020-09-17 08:25 AM
Hello @Eleon BORLINI
Yes I've found the solution thanks evryone for helping me.
I sent you an example of my main code and my interrupt code. I've just take another pin of the MCU to command the LED it was very simple when my MCU detect the interruption my LED blink but I've add another LED who should take on when no target is detected and off when target is detected. Sorry for my english i'm french.
In the bottom you will see the code. Thank you
2020-09-08 04:42 AM
Hi,
I m not sure that the GPIO1 has enough current to drive a LED. I think that it is better to connect the GPIO1 pin to a MCU GPIO to detect the event then from the MCU send a current to drive a LED ?
Thanks,
Julien
2020-09-09 01:23 AM
OK thank you Julien,
I've another questions :
In my main program, I'm calling the Sample_Ranging () functions to perform the measurement and the Sample_Interrupt () function to generate the interrupt but when I just call the sample_interrupt, I don't have a distance display in mm although with the new sample ready I have a show range.. How do you explain that ?
The other thing is if I want to add a new GPIO port from the mcu in which wait loop should I add the line of code to do it?
Thank you
2020-09-17 08:10 AM
Hi @MSAMB.1 ,
my suggestion to you is to share at least a section of your code to get more help on this last question.
-Eleon
2020-09-17 08:25 AM
Hello @Eleon BORLINI
Yes I've found the solution thanks evryone for helping me.
I sent you an example of my main code and my interrupt code. I've just take another pin of the MCU to command the LED it was very simple when my MCU detect the interruption my LED blink but I've add another LED who should take on when no target is detected and off when target is detected. Sorry for my english i'm french.
In the bottom you will see the code. Thank you
2020-09-17 08:28 AM
Good job @MSAMB.1 !
-Eleon
2020-09-17 11:55 PM
Thanks @Eleon BORLINI ,
I want now to make the calibration of the sensor to correct errors like precision and others I want to do that with a protection support, should I call the xtalk calibrat or the offset calibrate to do that ? Thanks for your response
2020-10-13 08:17 AM
Hi @Julien NGUYEN , we never closed this post... could you help @MSAMB.1 on this topic?
Thanks
-Eleon
2020-10-13 11:18 PM
Hi MSAMB, there is two calibrations . One is the offset calibration and the second one is the xtalk calibration.
You only need to do the calibration if you are looking for high precision measurement. If you only want to check if something/someone is present. You won't need.
If you add a cover glass (you called it protection support), depending on the cover glass (thickness, air-gap(distance between the sensor and the cover glass)) you may need to calibrate the cover glass. You may check out the application note DT0032 on st.com to learn how to calibrate the crosstalk I hope it helps. Thanks, Julien