adafruit-circuitpython-mlx90393 2.3.2__py3-none-any.whl → 2.3.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adafruit-circuitpython-mlx90393
3
- Version: 2.3.2
3
+ Version: 2.3.4
4
4
  Summary: CircuitPython driver for the MLX90393 3-axis magnetometer.
5
5
  Author-email: Adafruit Industries <circuitpython@adafruit.com>
6
6
  License: MIT
@@ -0,0 +1,6 @@
1
+ adafruit_mlx90393.py,sha256=QjMZELrI4JVe-gbleWzl2YgBBoT7TkYP_BBZeBYLXO0,21576
2
+ adafruit_circuitpython_mlx90393-2.3.4.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
3
+ adafruit_circuitpython_mlx90393-2.3.4.dist-info/METADATA,sha256=_uMogqd6HkOYJbOT-V5cb8RRbzWVOuZJrinNj3rIV9k,4084
4
+ adafruit_circuitpython_mlx90393-2.3.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
+ adafruit_circuitpython_mlx90393-2.3.4.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
6
+ adafruit_circuitpython_mlx90393-2.3.4.dist-info/RECORD,,
adafruit_mlx90393.py CHANGED
@@ -43,7 +43,7 @@ try:
43
43
  except ImportError:
44
44
  pass
45
45
 
46
- __version__ = "2.3.2"
46
+ __version__ = "2.3.4"
47
47
  __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MLX90393.git"
48
48
 
49
49
  _CMD_SB = const(0b00010000) # Start burst mode
@@ -226,6 +226,8 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
226
226
  self._osr = oversampling
227
227
  self._gain_current = gain
228
228
  self._temperature_compensation = temperature_compensation
229
+ # Typical value according the application note
230
+ self._tref = 0xB668
229
231
  self._off_x = self._off_y = self._off_z = offset
230
232
 
231
233
  # Put the device in a known state to start
@@ -519,6 +521,12 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
519
521
  print("Resetting sensor")
520
522
  time.sleep(0.002)
521
523
  self._transceive(bytes([_CMD_RT]))
524
+
525
+ # Read the temperature reference from register 0x24
526
+ self._tref = self.read_reg(0x24)
527
+ if self._debug:
528
+ print("Tref = {}".format(hex(self._tref)))
529
+
522
530
  # burn a read post reset
523
531
  try:
524
532
  self.magnetic
@@ -614,9 +622,6 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
614
622
  Reads a single temperature sample from the magnetometer.
615
623
  Temperature value in Celsius
616
624
  """
617
- # Read the temperature reference from register 0x24
618
- treference = self.read_reg(0x24)
619
-
620
625
  # Value taken from maximum time of temperature conversion on the datasheet section 12.
621
626
  # maximum time for temperature conversion = 1603 us
622
627
  delay = 0.1
@@ -637,4 +642,4 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
637
642
  tvalue = struct.unpack(">H", data[1:3])[0]
638
643
  # See previous link for conversion formula
639
644
 
640
- return 35 + ((tvalue - treference) / 45.2)
645
+ return 35 + ((tvalue - self._tref) / 45.2)
@@ -1,6 +0,0 @@
1
- adafruit_mlx90393.py,sha256=tTbuoICvkCIFWIm27sqrxMDyRm8CL6NLrma9Eeyv89U,21413
2
- adafruit_circuitpython_mlx90393-2.3.2.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
3
- adafruit_circuitpython_mlx90393-2.3.2.dist-info/METADATA,sha256=cw5kugTu2XX7j0lpXqxUFf3S8YQTPfkyVf51LnHRWkU,4084
4
- adafruit_circuitpython_mlx90393-2.3.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
- adafruit_circuitpython_mlx90393-2.3.2.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
6
- adafruit_circuitpython_mlx90393-2.3.2.dist-info/RECORD,,