File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ def channel(self):
68
68
@channel .setter
69
69
def channel (self , channel : int ):
70
70
"""
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 .
72
72
73
73
:param bits: 8-bit value representing the channels to be selected/deselected.
74
74
:type bits: int
75
75
"""
76
- bits = 1 << ( channel - 1 )
76
+ bits = 1 << channel
77
77
try :
78
78
with self .i2c_device as i2c :
79
79
i2c .write (bytes ([bits ]))
@@ -91,14 +91,14 @@ def channels(self):
91
91
@channels .setter
92
92
def channels (self , channels : typing .List [int ]):
93
93
"""
94
- Selects multiple channels on the ADG72x chip. Channel numbering starts at 1.
94
+ Selects multiple channels on the ADG72x chip.
95
95
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.
97
97
:type channels: List[int]
98
98
"""
99
99
bits = 0
100
100
for channel in channels :
101
- bits |= 1 << ( channel - 1 )
101
+ bits |= 1 << channel
102
102
try :
103
103
with self .i2c_device as i2c :
104
104
i2c .write (bytes ([bits ]))
You can’t perform that action at this time.
0 commit comments