This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

VL53L0X + Interrupts

I'm hoping someone here is familiar with the VL53L0X setup on a NRF52 board. I was able to get the single range measurements working just fine using polling and now I want to take it to the next level, using an IRQ line. What I want it to do is, when no motion is being detected, nothing is happening, then when motion is detected, the measurements are spit out. What I assume needs to be done is the sensor needs to be put into continuous mode so it's constantly checking for motion and when it detects motion, it sends an interrupt to the board through GPIO1 to the board, which then gives me the measurements.

What I have working so far with an IRQ line only works in single ranging mode. I have GPIO1 connected to the same pinout as a button on the board. When I flash the board, nothing happens, as I expected. I press the button, interrupt sent, measurement is gathered, which triggers another interrupt and gives me that measurement, and that triggers an interrupt, and you see where that is going, until the measurement goes outside of the threshold I set to where it stops until the I press the button again and it will give me the measurements again while in the threshold. So when I changed the DeviceMode to Continuous mode, nothing works. It doesn't trigger any interrupts and when I press the button, it gives me the same incorrect value every time I press the button, it makes zero sense to me. I'm not sure what else to post to give you guys information to help, so please let me know. Thank you.

Related