Skip to content

Call VL53L0X.open() after GPIO goes HIGH - #4

Merged
grantramsay merged 1 commit into
grantramsay:masterfrom
jonghoonseo:fix/multi_example
Oct 9, 2018
Merged

Call VL53L0X.open() after GPIO goes HIGH#4
grantramsay merged 1 commit into
grantramsay:masterfrom
jonghoonseo:fix/multi_example

Conversation

@w4-jonghoon

Copy link
Copy Markdown

There was an issue to execute VL53L0X_multi_example.py.

pi@raspberrypi:~/jseo/VL53L0X_rasp_python/python $ python VL53L0X_multi_example.py
VL53L0X Start Ranging Address 0x2B

Setting I2C Address to 0x2B
Call of VL53L0X_SetAddress
API Status: -20 : Control Interface Error
VL53L0X Start Ranging Address 0x2D

Setting I2C Address to 0x2D
Call of VL53L0X_SetAddress
API Status: -20 : Control Interface Error
VL53L0X_BETTER_ACCURACY_MODE
API Status: 0 : No Error
VL53L0X_BETTER_ACCURACY_MODE
Set Accuracy
API Status: -20 : Control Interface Error
Timing 20 ms

I figured out that is because calling VL53L0X.open() before GPIO goes High (GPIO.output(sensor[12]_shutdown, GPIO.HIGH).
The problem - Control Interface Error was occurred while writing to i2c bus in VL53L0X_SetDeviceAddress() in vl53l0x_api.c.
I'm not sure it is safe to make GPIO high before the calling the function(VL53L0X.open()), but it is working.
Please review change and pull the patch.

@grantramsay
grantramsay merged commit 6ce4c0b into grantramsay:master Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants