Skip to content

Commit 1f7bbe3

Browse files
committed
code format
1 parent 5285ba8 commit 1f7bbe3

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

adafruit_vl53l1x.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ def roi_xy(self):
297297
"""Returns the x and y coordinates of the sensor's region of interest"""
298298
temp = self._read_register(_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE)
299299

300-
x = (int.from_bytes(temp, 'big') & 0x0F) + 1
301-
y = ((int.from_bytes(temp, 'big') & 0xF0) >> 4) + 1
300+
x = (int.from_bytes(temp, "big") & 0x0F) + 1
301+
y = ((int.from_bytes(temp, "big") & 0xF0) >> 4) + 1
302302

303303
return x, y
304304

@@ -313,23 +313,21 @@ def roi_xy(self, data):
313313
if x > 10 or y > 10:
314314
optical_center = 199
315315

316-
self._write_register(
317-
_ROI_CONFIG__USER_ROI_CENTRE_SPAD, optical_center.to_bytes(1, 'big')
318-
)
316+
self._write_register(_ROI_CONFIG__USER_ROI_CENTRE_SPAD, optical_center.to_bytes(1, "big"))
319317
self._write_register(
320318
_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE,
321-
((y - 1) << 4 | (x - 1)).to_bytes(1, 'big'),
319+
((y - 1) << 4 | (x - 1)).to_bytes(1, "big"),
322320
)
323321

324322
@property
325323
def roi_center(self):
326324
"""Returns the center of the sensor's region of interest"""
327325
temp = self._read_register(_ROI_CONFIG__USER_ROI_CENTRE_SPAD)
328-
return int.from_bytes(temp,'big')
326+
return int.from_bytes(temp, "big")
329327

330328
@roi_center.setter
331329
def roi_center(self, center):
332-
self._write_register(_ROI_CONFIG__USER_ROI_CENTRE_SPAD, center.to_bytes(1, 'big'))
330+
self._write_register(_ROI_CONFIG__USER_ROI_CENTRE_SPAD, center.to_bytes(1, "big"))
333331

334332
def _write_register(self, address, data, length=None):
335333
if length is None:

0 commit comments

Comments
 (0)