Skip to content

Commit 8a555c0

Browse files
author
Ramsay, Grant (NZ)
committed
Use smbus2
Simpler python based implementation, works fine on Raspberry PI
1 parent bc58642 commit 8a555c0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

python/VL53L0X.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import time
2626
from ctypes import *
27-
import smbus
27+
import smbus2 as smbus
2828

2929
VL53L0X_GOOD_ACCURACY_MODE = 0 # Good Accuracy mode
3030
VL53L0X_BETTER_ACCURACY_MODE = 1 # Better Accuracy mode

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ class CTypesExtension(Extension):
5353
ext_modules=[extension],
5454
package_dir={'': 'python'},
5555
py_modules=['VL53L0X'],
56+
requires=['smbus2'],
5657
cmdclass={'build_ext': build_ext})

0 commit comments

Comments
 (0)