Commit 382345b0 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Tries to implement switch_on in mux_2024

Showing with 1 addition and 21 deletions
+1 -21
......@@ -15,6 +15,7 @@ class Mux(MuxAbstract):
self.max_elec = MUX_CONFIG['max_elec']
if self.addresses is None and 'addresses' in MUX_CONFIG.keys():
self._get_addresses(MUX_CONFIG['addresses'])
self.debug(f'Using {MUX_CONFIG["addresses"]} for {self.board_name}...')
def reset(self):
pass
......@@ -42,26 +43,5 @@ class Mux(MuxAbstract):
if state == 'off':
set_relay_state(mcp, d['MCP_GPIO'], False)
# self.tca = adafruit_tca9548a.TCA9548A(i2c, self.addresses[role])
# # find I2C address of the electrode and corresponding relay
# # considering that one MCP23017 can cover 16 electrodes
# i2c_address = 7 - (elec - 1) // 16 # quotient without rest of the division
# relay = (elec - 1) - ((elec - 1) // 16) * 16
#
# if i2c_address is not None:
# # select the MCP23017 of the selected MUX board
# mcp = MCP23017(self.tca[i2c_address])
# mcp.get_pin(relay - 1).direction = digitalio.Direction.OUTPUT
# if state == 'on':
# mcp.get_pin(relay - 1).value = True
# else:
# mcp.get_pin(relay - 1).value = False
# # exec_logger.debug(f'Switching relay {relay} '
# # f'({str(hex(self.addresses[role]))}) on:{on} for electrode {elec}')
# else:
# raise ValueError('No I2C address found for the electrode'
# ' {:d} on board {:s}'.format(elec, self.addresses[role]))
# # exec_logger.warning(f'Unable to address electrode nr {elec}')
def test(self, *args):
MuxAbstract.test(self, *args)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment