E
E
evgeniy_lm2022-02-19 13:15:31
Arduino
evgeniy_lm, 2022-02-19 13:15:31

How to handle VL53L0X rangefinder interrupts?

I use the Blue Pill board and the VL53L0X-V2 distance sensor in conjunction with the . In the single measurement mode, as in the test case, everything works fine, but I would like to use interrupts. How to do this is completely unclear. If the interrupt is activated before the sensor_vl53l0x.InitSensor function and the sensor_vl53l0x.GetDistance function is called in the interrupt handler, then it waits for the measurement to occur, as a result of which a new interrupt is generated, for this reason the main loop of the loop program is not executed. If an interrupt is activated after sensor_vl53l0x.InitSensor, the sensor is switched to single measurement mode and the interrupt handler is not executed (no measurements are taken).
There are two questions:
1. How to set up the sensor in cyclic measurement mode?
2. How to get data from the sensor in the interrupt handler?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question