from ctypes import *
from secg40 import *
import sys
import time


device = SECG40(get_lib_path())

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

print('device is connected... ({})'.format(
    device.get_serial_number()))

device.reset()


device.set_output_function(OutputFunction_E.Output_ECG2_27.value)
device.set_frequency(0.1)
device.set_ecg_2_27_noise(ECG2_27_NoiseFreq_E.Noise_50Hz.value, 0.1)

time.sleep(10.0)

device.set_output_function(OutputFunction_E.Output_Off.value)
device.close()
