adafruit-circuitpython-mlx90393 2.2.0__py3-none-any.whl → 2.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {adafruit_circuitpython_mlx90393-2.2.0.dist-info → adafruit_circuitpython_mlx90393-2.3.0.dist-info}/METADATA +1 -1
- adafruit_circuitpython_mlx90393-2.3.0.dist-info/RECORD +6 -0
- {adafruit_circuitpython_mlx90393-2.2.0.dist-info → adafruit_circuitpython_mlx90393-2.3.0.dist-info}/WHEEL +1 -1
- adafruit_mlx90393.py +53 -1
- adafruit_circuitpython_mlx90393-2.2.0.dist-info/RECORD +0 -6
- {adafruit_circuitpython_mlx90393-2.2.0.dist-info → adafruit_circuitpython_mlx90393-2.3.0.dist-info}/LICENSE +0 -0
- {adafruit_circuitpython_mlx90393-2.2.0.dist-info → adafruit_circuitpython_mlx90393-2.3.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
adafruit_mlx90393.py,sha256=LRvJwO5NoOGxFvHsZOm7RoL-2k5Uj4tWY2jXM2gPiMA,21409
|
2
|
+
adafruit_circuitpython_mlx90393-2.3.0.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
|
3
|
+
adafruit_circuitpython_mlx90393-2.3.0.dist-info/METADATA,sha256=2fwE481A0KquP94E2w_CYgMt2fskSfmbHqn0XWCpATc,4084
|
4
|
+
adafruit_circuitpython_mlx90393-2.3.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
5
|
+
adafruit_circuitpython_mlx90393-2.3.0.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
|
6
|
+
adafruit_circuitpython_mlx90393-2.3.0.dist-info/RECORD,,
|
adafruit_mlx90393.py
CHANGED
@@ -43,7 +43,7 @@ try:
|
|
43
43
|
except ImportError:
|
44
44
|
pass
|
45
45
|
|
46
|
-
__version__ = "2.
|
46
|
+
__version__ = "2.3.0"
|
47
47
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MLX90393.git"
|
48
48
|
|
49
49
|
_CMD_SB = const(0b00010000) # Start burst mode
|
@@ -65,6 +65,9 @@ _CMD_REG_CONF1 = const(0x00) # Gain
|
|
65
65
|
_CMD_REG_CONF2 = const(0x01) # Burst, comm mode, temperature compensation
|
66
66
|
_CMD_REG_CONF3 = const(0x02) # Oversampling, Filter, Resolution
|
67
67
|
_CMD_REG_CONF4 = const(0x03) # Sensitivity drift
|
68
|
+
_CMD_REG_CONF5 = const(0x04) # X-axis Offset Correction
|
69
|
+
_CMD_REG_CONF6 = const(0x05) # Y-axis Offset Correction
|
70
|
+
_CMD_REG_CONF7 = const(0x06) # Z-axis Offset Correction
|
68
71
|
|
69
72
|
# Gain settings
|
70
73
|
GAIN_5X = 0x0
|
@@ -212,6 +215,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
212
215
|
filt: int = FILTER_7,
|
213
216
|
oversampling: int = OSR_3,
|
214
217
|
temperature_compensation: bool = False,
|
218
|
+
offset: int = 0,
|
215
219
|
debug: bool = False,
|
216
220
|
) -> None:
|
217
221
|
self.i2c_device = I2CDevice(i2c_bus, address)
|
@@ -222,6 +226,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
222
226
|
self._osr = oversampling
|
223
227
|
self._gain_current = gain
|
224
228
|
self._temperature_compensation = temperature_compensation
|
229
|
+
self._off_x = self._off_y = self._off_z = offset
|
225
230
|
|
226
231
|
# Put the device in a known state to start
|
227
232
|
self.reset()
|
@@ -241,6 +246,11 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
241
246
|
self.gain = self._gain_current
|
242
247
|
self.temperature_compensation = self._temperature_compensation
|
243
248
|
|
249
|
+
# Set offsets to supplied level
|
250
|
+
self.offset_x = self._off_x
|
251
|
+
self.offset_y = self._off_y
|
252
|
+
self.offset_z = self._off_z
|
253
|
+
|
244
254
|
def _transceive(self, payload: ReadableBuffer, rxlen: int = 0) -> bytearray:
|
245
255
|
"""
|
246
256
|
Writes the specified 'payload' to the sensor
|
@@ -402,6 +412,48 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
402
412
|
self.write_reg(_CMD_REG_CONF2, reg)
|
403
413
|
self._temperature_compensation = temperature_compensation
|
404
414
|
|
415
|
+
@property
|
416
|
+
def offset_x(self) -> int:
|
417
|
+
"""The X axis offset."""
|
418
|
+
return self._off_x
|
419
|
+
|
420
|
+
@offset_x.setter
|
421
|
+
def offset_x(self, offset: int) -> None:
|
422
|
+
self._set_offset(0, offset)
|
423
|
+
self._off_x = offset
|
424
|
+
|
425
|
+
@property
|
426
|
+
def offset_y(self) -> int:
|
427
|
+
"""The Y axis offset."""
|
428
|
+
return self._off_y
|
429
|
+
|
430
|
+
@offset_y.setter
|
431
|
+
def offset_y(self, offset: int) -> None:
|
432
|
+
self._set_offset(1, offset)
|
433
|
+
self._off_y = offset
|
434
|
+
|
435
|
+
@property
|
436
|
+
def offset_z(self) -> int:
|
437
|
+
"""The Z axis offset."""
|
438
|
+
return self._off_z
|
439
|
+
|
440
|
+
@offset_z.setter
|
441
|
+
def offset_z(self, offset: int) -> None:
|
442
|
+
self._set_offset(2, offset)
|
443
|
+
self._off_z = offset
|
444
|
+
|
445
|
+
def _set_offset(self, axis: int, offset: int) -> None:
|
446
|
+
if offset < 0x0000 or offset > 0xFFFF:
|
447
|
+
raise ValueError("Incorrect offset setting.")
|
448
|
+
if axis == 0:
|
449
|
+
self.write_reg(_CMD_REG_CONF5, offset)
|
450
|
+
elif axis == 1:
|
451
|
+
self.write_reg(_CMD_REG_CONF6, offset)
|
452
|
+
elif axis == 2:
|
453
|
+
self.write_reg(_CMD_REG_CONF7, offset)
|
454
|
+
else:
|
455
|
+
raise ValueError("Incorrect axis setting.")
|
456
|
+
|
405
457
|
def display_status(self) -> None:
|
406
458
|
"""
|
407
459
|
Prints out the content of the last status byte in a human-readable
|
@@ -1,6 +0,0 @@
|
|
1
|
-
adafruit_mlx90393.py,sha256=x01r3I_OliE3J9tt3Y_0LQswVOjCqI-mYmqusmwyixY,19835
|
2
|
-
adafruit_circuitpython_mlx90393-2.2.0.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
|
3
|
-
adafruit_circuitpython_mlx90393-2.2.0.dist-info/METADATA,sha256=wG-t6WHv4TEbnl3J9sx9iqjMUBCauluWJvauc9HIq8A,4084
|
4
|
-
adafruit_circuitpython_mlx90393-2.2.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
5
|
-
adafruit_circuitpython_mlx90393-2.2.0.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
|
6
|
-
adafruit_circuitpython_mlx90393-2.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|