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('output Sine (10Hz, 5mV, DUT1, LA) ...', end='')
sys.stdout.flush()

channel = OutputDut.DUT1.value
device.reset()
device.set_frequency(10.0)
device.set_amplitude(5.0)
#device.set_output_lead(channel, OutputLead.Lead_RA.value)
device.set_output_lead(channel, OutputLead.Lead_LA.value)

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

device.set_output_function(OutputFunction.Output_Sine.value)

time.sleep(10)
device.set_output_function(OutputFunction.Output_Off.value)  # stop output
device.free()

print('done')
