Skip to content

Commit 6b33acd

Browse files
authored
Merge pull request #598 from Kantipudi-Supriya/ad7191
Ad7191
2 parents 7844e9d + 33aeb03 commit 6b33acd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

adi/ad719x.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, uri="", device_name=""):
2424
"""Constructor for AD719x class."""
2525
context_manager.__init__(self, uri, self._device_name)
2626

27-
compatible_parts = ["ad7190", "ad7192", "ad7193", "ad7194", "ad7195"]
27+
compatible_parts = ["ad7190", "ad7191","ad7192", "ad7193", "ad7194", "ad7195"]
2828

2929
self._ctrl = None
3030

@@ -90,14 +90,15 @@ def offset(self, value):
9090
def to_volts(self, index, val):
9191
"""Converts raw value to SI."""
9292
_scale = self.channel[index].scale
93+
_offset = self.channel[index].offset
9394

9495
ret = None
9596

9697
if isinstance(val, np.int32):
97-
ret = val * _scale
98+
ret = (val + _offset) / 1000 * _scale
9899

99100
if isinstance(val, np.ndarray):
100-
ret = [x * _scale for x in val]
101+
ret = [((x + _offset) / 1000) * _scale for x in val]
101102

102103
if ret is None:
103104
raise Exception("Error in converting to actual voltage")

supported_parts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
- AD7176-2
8888
- AD7177-2
8989
- AD7190
90+
- AD7191
9091
- AD7192
9192
- AD7193
9293
- AD7194

0 commit comments

Comments
 (0)