Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Give the opportunity to set the polarity to 1 and not 0.
Given that the MAX31865 can deal with both, it seems reasonable to expose this in the interface.
  • Loading branch information
emmanuelthome committed May 25, 2021
commit b9610cb5ede158fe89c5492bf40740cf6f911558
4 changes: 3 additions & 1 deletion adafruit_max31865.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class MAX31865:
:param int ref_resistor: Reference resistance. Defaults to :const:`430.0`
:param int wires: Number of wires. Defaults to :const:`2`
:param int filter_frequency: . Filter frequency. Default to :const:`60`
:param int polarity: set to 1 if controller clock idles high. Default 0.


**Quickstart: Importing and using the MAX31865**
Expand Down Expand Up @@ -120,6 +121,7 @@ def __init__(
spi,
cs,
*,
polarity=0,
rtd_nominal=100,
ref_resistor=430.0,
wires=2,
Expand All @@ -128,7 +130,7 @@ def __init__(
self.rtd_nominal = rtd_nominal
self.ref_resistor = ref_resistor
self._device = spi_device.SPIDevice(
spi, cs, baudrate=500000, polarity=0, phase=1
spi, cs, baudrate=500000, polarity=polarity, phase=1
)
# Set 50Hz or 60Hz filter.
if filter_frequency not in (50, 60):
Expand Down