Commit 8b1cd5ef authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Updates test

Showing with 4 additions and 2 deletions
+4 -2
...@@ -35,21 +35,23 @@ if stand_alone: ...@@ -35,21 +35,23 @@ if stand_alone:
MUX_CONFIG.update({'connection': MUX_CONFIG.pop('connection', ctl.interfaces[ MUX_CONFIG.update({'connection': MUX_CONFIG.pop('connection', ctl.interfaces[
MUX_CONFIG.pop('interface_name', 'i2c')])}) MUX_CONFIG.pop('interface_name', 'i2c')])})
MUX_CONFIG.update({'id': mux_id}) MUX_CONFIG.update({'id': mux_id})
print(MUX_CONFIG['cabling'])
rx = rx_module.Rx(**HARDWARE_CONFIG['rx']) rx = rx_module.Rx(**HARDWARE_CONFIG['rx'])
tx = tx_module.Tx(**HARDWARE_CONFIG['tx']) tx = tx_module.Tx(**HARDWARE_CONFIG['tx'])
pwr = pwr_module.Pwr(**HARDWARE_CONFIG['pwr']) pwr = pwr_module.Pwr(**HARDWARE_CONFIG['pwr'])
mux = mux_module.Mux(**MUX_CONFIG) mux = mux_module.Mux(**MUX_CONFIG)
print(mux.cabling)
tx.polarity = 1 tx.polarity = 1
time.sleep(1) time.sleep(1)
tx.polarity = 0 tx.polarity = 0
mux.switch(elec_dict={'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='on') mux.switch(elec_dict={'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='on')
time.sleep(1) time.sleep(1)
voltage = rx.voltage
current = tx.current
mux.switch(elec_dict={'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='off') mux.switch(elec_dict={'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='off')
print(f'Resistance: {voltage / current :.2f} ohm, voltage: {voltage:.2f} mV, current: {current:.2f} mA')
# mux as part of a OhmPiHardware system # mux as part of a OhmPiHardware system
if part_of_hardware_system: if part_of_hardware_system:
from ohmpi.hardware_system import OhmPiHardware from ohmpi.hardware_system import OhmPiHardware
......
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