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 Square (1Hz, 1mV, DUT1, RA) ...', end='')
sys.stdout.flush()

device.reset()
device.set_frequency(1.0)
device.set_amplitude(1.0)
device.set_output_lead(OutputDut.DUT1.value, OutputLead.Lead_RA.value)
device.set_output_function(OutputFunction.Output_Square.value)

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

print('done')
