Skip to content

Commit a7e6843

Browse files
committed
Update adafruit_vl53l1x.py
Fixed last update that only fixed first issue.
1 parent ee74252 commit a7e6843

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_vl53l1x.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ def distance_mode(self, mode):
301301
def roi_xy(self):
302302
"""Returns the x and y coordinates of the sensor's region of interest"""
303303
temp = self._read_register(_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE)
304-
x = (int.from_bytes(temp) & 0x0F) + 1
305-
y = ((int.from_bytes(temp, 'little') & 0xF0) >> 4) + 1
304+
x = (int.from_bytes(temp, "little") & 0x0F) + 1
305+
y = ((int.from_bytes(temp, "little") & 0xF0) >> 4) + 1
306306

307307
return x, y
308308

@@ -318,18 +318,18 @@ def roi_xy(self, data):
318318
optical_center = 199
319319

320320
self._write_register(
321-
_ROI_CONFIG__USER_ROI_CENTRE_SPAD, optical_center.to_bytes(1,'little')
321+
_ROI_CONFIG__USER_ROI_CENTRE_SPAD, optical_center.to_bytes(1,"little")
322322
)
323323
self._write_register(
324324
_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE,
325-
((y - 1) << 4 | (x - 1)).to_bytes(1,'little'),
325+
((y - 1) << 4 | (x - 1)).to_bytes(1,"little"),
326326
)
327327

328328
@property
329329
def roi_center(self):
330330
"""Returns the center of the sensor's region of interest"""
331331
temp = self._read_register(_ROI_CONFIG__USER_ROI_CENTRE_SPAD)
332-
return int.from_bytes(temp, 'little')
332+
return int.from_bytes(temp, "little")
333333

334334
@roi_center.setter
335335
def roi_center(self, center):

0 commit comments

Comments
 (0)