-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interrupt Example don't work #60
Comments
The description is confusing. Can you post the output you are seeing in the Serial Monitor when running the example. |
Set GPIO Config so if range is lower the LowThreshold trigger Gpio Pin |
Thanks. The output looks generally as expected. Is the issue that the distance value is not changing? Does the non-interrupt example work OK on the same setup? |
Thank you for your quick answer! |
Hi! Is it possible that I am using a VL53L0X V2 (https://de.aliexpress.com/item/32851036504.html)? |
Please post in the forums with photos of your setup showing how everything is connected. |
The issue with the example is the high threshold is not used and it should trigger when the ranged value is BELOW the low threshold (5cm)... because The API details and how the thresholds can be defined is explained in the UM2039 API User Manual |
Is there an actual issue with the example? Or is this just confusion about the interrupt behavior? |
`#define INTERRUPT_PIN P1_5 Adafruit_VL53L0X sensor = Adafruit_VL53L0X(); void setup() { // wait until serial port opens for native USB devices pinMode(INTERRUPT_PIN, INPUT_PULLUP); // Configura il pin di interruzione come input if (!sensor.begin()) { // Configura il sensore per abilitare l'interruzione su nuova misurazione sensor.setGpioConfig( VL53L0X_DEVICEMODE_CONTINUOUS_RANGING, } void loop() { Serial.print("Reading a measurement... "); if (measure.RangeStatus != 4) { // phase failures have incorrect data delay(1000); void interruptHandler(){ This is my code, I use a MSP432P401 board and coding on Energia IDE; if I comment the attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), interruptHandler, FALLING); line all work, if Itry to use interrupt uncomment this line i can't see anything on the serial console |
The interrupt example doesn't work. The interrupt is simply ignored. I.e. the distance is displayed although only the range of 50-100mm should be displayed.
The text was updated successfully, but these errors were encountered: