import serial
import io
import time

ser = serial.Serial(port='com16', baudrate=9600, timeout=1)

ser.isOpen()

ser.write("/MAX30001/WriteReg 2 3\r\n".encode())
print(ser.readline())
ser.write("/MAX30001/WriteReg 3 3\r\n".encode())
print(ser.readline())


#time.sleep(5)
#for x in range (0, 100):
ser.write("/MAX30001/INT_assignment 1 0 0 2 1 0 2 2 0 1 0 0 2 1 0 3 3\r\n".encode())
print(ser.readline())

ser.write("/MAX30001/WriteReg 10 080004\r\n".encode())
print(ser.readline())

ser.write("/MAX30001/ReadReg 2\r\n".encode())
print(ser.readline())
ser.write("/MAX30001/ReadReg 3\r\n".encode())
print(ser.readline())

ser.close()
