from wecg400 import *

device = WECG400(get_lib_path())
if not device.connect(-1, 5000):
    print('Error: device is not connected')
    device.free()
    sys.exit()

print('set input impedance 620kΩ ...', end='')
sys.stdout.flush()

channel = OutputDut.DUT1.value
device.reset()
device.set_output_lead(channel, OutputLead.Lead_RA.value)
device.set_input_impedance(channel, 1)   # mode 1: 620kΩ

time.sleep(10)
print('done')

print('set input impedance 10MΩ  ...', end='')
sys.stdout.flush()
device.set_input_impedance(channel, 2)   # mode 2: 10MΩ

time.sleep(10)
print('done')

print('set input impedance 100Ω ...', end='')
sys.stdout.flush()
device.set_input_impedance(channel, 0)   # mode 0: 100Ω (default mode)

time.sleep(10)
device.free()

print('done')
