Commit 3ddff4b7 authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Updates mux v2024 addressing

No related merge requests found
Showing with 7 additions and 4 deletions
+7 -4
...@@ -13,6 +13,7 @@ mux_addressing_table_file = os.path.join(mux_board_version,"relay_board_32",mux_ ...@@ -13,6 +13,7 @@ mux_addressing_table_file = os.path.join(mux_board_version,"relay_board_32",mux_
electrode_nr = 1 electrode_nr = 1
role = "A" role = "A"
# state = on
with open(mux_addressing_table_file, 'r') as myfile: with open(mux_addressing_table_file, 'r') as myfile:
header = myfile.readlines()[0].strip('\n').split(',') header = myfile.readlines()[0].strip('\n').split(',')
...@@ -39,5 +40,7 @@ else: ...@@ -39,5 +40,7 @@ else:
tca = i2c tca = i2c
mcp_addr = hex(int(mux_addressing_table['MCP_address'][idx][0], 16)) mcp_addr = hex(int(mux_addressing_table['MCP_address'][idx][0], 16))
MCP23017(tca, address=mcp_addr) MCP23017(tca, address=mcp_addr)
if state == 'on'
set_relay_state(mcp_addr,, True) set_relay_state(mcp_addr,mcp_gpio, True)
\ No newline at end of file time.sleep(2)
set_relay_state(mcp_addr,mcp_gpio, True)
\ No newline at end of file
...@@ -1340,9 +1340,9 @@ class OhmPi(object): ...@@ -1340,9 +1340,9 @@ class OhmPi(object):
tca = adafruit_tca9548a.TCA9548A(self.i2c, hex(int(tca_addr,16)))[tca_channel] tca = adafruit_tca9548a.TCA9548A(self.i2c, hex(int(tca_addr,16)))[tca_channel]
mcp_addr = hex(int(mux_addressing_table['MCP_address'][idx][0], 16)) mcp_addr = hex(int(mux_addressing_table['MCP_address'][idx][0], 16))
MCP23017(tca, address=mcp_addr) MCP23017(tca, address=mcp_addr)
if state == 'on' if state == 'on':
set_relay_state(mcp_addr, mcp_gpio, True) set_relay_state(mcp_addr, mcp_gpio, True)
if state == 'off' if state == 'off':
set_relay_state(mcp_addr, mcp_gpio, False) set_relay_state(mcp_addr, mcp_gpio, False)
else: else:
......
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