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 Rectangle Pulse (1Hz, 1mv, 100ms, DUT1, RA) ...', end='')
sys.stdout.flush()

device.reset()
device.set_frequency(c_double(1.0))
device.set_amplitude(c_double(1.0))
device.set_pulse_width(c_double(100))
device.set_output_lead(OutputDut.DUT1.value, OutputLead.Lead_RA.value)
device.set_output_function(OutputFunction.Output_RectanglePulse.value)

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

print('done')
