Skip to content

Commit 046bac4

Browse files
committed
update channel range
1 parent d05ff91 commit 046bac4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_adg72x.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def channel(self):
6868
@channel.setter
6969
def channel(self, channel: int):
7070
"""
71-
Selects a single channel on the ADG72x chip. Channel numbering starts at 1.
71+
Selects a single channel on the ADG72x chip. Channel numbering starts at 0.
7272
7373
:param bits: 8-bit value representing the channels to be selected/deselected.
7474
:type bits: int
7575
"""
76-
bits = 1 << (channel - 1)
76+
bits = 1 << channel
7777
try:
7878
with self.i2c_device as i2c:
7979
i2c.write(bytes([bits]))
@@ -91,14 +91,14 @@ def channels(self):
9191
@channels.setter
9292
def channels(self, channels: typing.List[int]):
9393
"""
94-
Selects multiple channels on the ADG72x chip. Channel numbering starts at 1.
94+
Selects multiple channels on the ADG72x chip.
9595
96-
:param channels: A list of channel numbers to be selected.
96+
:param channels: A list of channel numbers to be selected. Channel numbering starts at 0.
9797
:type channels: List[int]
9898
"""
9999
bits = 0
100100
for channel in channels:
101-
bits |= 1 << (channel - 1)
101+
bits |= 1 << channel
102102
try:
103103
with self.i2c_device as i2c:
104104
i2c.write(bytes([bits]))

0 commit comments

Comments
 (0)