Skip to content

Commit

Permalink
ads1x15.py: Fixed an Copy/Paste error at method read()
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-hh committed Mar 29, 2017
1 parent 0747085 commit 26c558d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ads1x15.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def set_conv(self, rate, channel1, channel2 = None):

def read(self, rate, channel1, channel2 = None):
"""Read voltage between a channel and GND. Time depends on conversion rate."""
self.mode = (_CQUE_NONE | _CLAT_NONLAT |
self._write_register(_REGISTER_CONFIG, (_CQUE_NONE | _CLAT_NONLAT |
_CPOL_ACTVLOW | _CMODE_TRAD | _RATES[rate] | _MODE_SINGLE |
_OS_SINGLE | _GAINS[self.gain] | _CHANNELS[(channel1, channel2)])
_OS_SINGLE | _GAINS[self.gain] | _CHANNELS[(channel1, channel2)]))
while not self._read_register(_REGISTER_CONFIG) & _OS_NOTBUSY:
time.sleep_ms(1)
return self._read_register(_REGISTER_CONVERT)
Expand All @@ -165,7 +165,7 @@ def alert_start(self, rate, channe1l, channel2 = None, threshold_high = 0x4000):
_MODE_CONTIN | _GAINS[self.gain] | _CHANNELS[(channel1, channel2)])

def conversion_start(self, rate, channel1, channel2 = None):
"""Start continuous measurement, trigegr on ALERT/RDY pin."""
"""Start continuous measurement, trigger on ALERT/RDY pin."""
self._write_register(_REGISTER_LOWTHRESH, 0)
self._write_register(_REGISTER_HITHRESH, 0x8000)
self._write_register(_REGISTER_CONFIG, _CQUE_1CONV | _CLAT_NONLAT |
Expand Down

0 comments on commit 26c558d

Please sign in to comment.