repo time
Dependencies: mbed MAX14720 MAX30205 USBDevice
HspGuiSourceV301/Script/hsp_streamstartstop.py@20:6d2af70c92ab, 2021-04-06 (annotated)
- Committer:
- darienf
- Date:
- Tue Apr 06 06:41:40 2021 +0000
- Revision:
- 20:6d2af70c92ab
another repo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
darienf | 20:6d2af70c92ab | 1 | import serial |
darienf | 20:6d2af70c92ab | 2 | import io |
darienf | 20:6d2af70c92ab | 3 | import time |
darienf | 20:6d2af70c92ab | 4 | |
darienf | 20:6d2af70c92ab | 5 | ser = serial.Serial(port='com16', baudrate=9600, timeout=1) |
darienf | 20:6d2af70c92ab | 6 | |
darienf | 20:6d2af70c92ab | 7 | ser.isOpen() |
darienf | 20:6d2af70c92ab | 8 | |
darienf | 20:6d2af70c92ab | 9 | for x in range (0, 3): |
darienf | 20:6d2af70c92ab | 10 | print('-------------Test Start-------------------------------') |
darienf | 20:6d2af70c92ab | 11 | ser.write("/MAX30001/INT_assignment 1 0 0 2 2 0 2 2 0 1 0 0 2 1 0 3 3\r\n".encode()) |
darienf | 20:6d2af70c92ab | 12 | print(ser.readline()) |
darienf | 20:6d2af70c92ab | 13 | ser.write("/MAX30001/ECG_InitStart 01 00 00 00 00 00 0F 02 00 01 01\r\n".encode()) |
darienf | 20:6d2af70c92ab | 14 | print(ser.readline()) |
darienf | 20:6d2af70c92ab | 15 | ser.write("/MAX30001/PACE_InitStart 01 00 00 00 00 00 00 05 05\r\n".encode()) |
darienf | 20:6d2af70c92ab | 16 | print(ser.readline()) |
darienf | 20:6d2af70c92ab | 17 | ser.write("/MAX30001/BIOZ_InitStart 01 01 01 00 00 00 07 00 02 00 00 00 01 08 00 00 00\r\n".encode()) |
darienf | 20:6d2af70c92ab | 18 | print(ser.readline()) |
darienf | 20:6d2af70c92ab | 19 | ser.write("/MAX30001/RtoR_InitStart 01 03 0F 02 03 20 02 04 01\r\n".encode()) |
darienf | 20:6d2af70c92ab | 20 | print(ser.readline()) |
darienf | 20:6d2af70c92ab | 21 | ser.write("/MAX30001/Start\r\n".encode()) |
darienf | 20:6d2af70c92ab | 22 | |
darienf | 20:6d2af70c92ab | 23 | for i in range (0,3): |
darienf | 20:6d2af70c92ab | 24 | print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 25 | |
darienf | 20:6d2af70c92ab | 26 | ser.write(" ".encode()) |
darienf | 20:6d2af70c92ab | 27 | print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 28 | |
darienf | 20:6d2af70c92ab | 29 | #ser.write("/MAX30001/WriteReg 10 E0004\r\n".encode()) |
darienf | 20:6d2af70c92ab | 30 | #print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 31 | ser.write("/MAX30001/ReadReg 1D\r\n".encode()) |
darienf | 20:6d2af70c92ab | 32 | print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 33 | ser.write("/MAX30001/WriteReg 1D 3FA300\r\n".encode()) |
darienf | 20:6d2af70c92ab | 34 | print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 35 | ser.write("/MAX30001/WriteReg 02 03\r\n".encode()) |
darienf | 20:6d2af70c92ab | 36 | print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 37 | ser.write("/MAX30001/WriteReg 03 03\r\n".encode()) |
darienf | 20:6d2af70c92ab | 38 | print(ser.read(100)) |
darienf | 20:6d2af70c92ab | 39 | |
darienf | 20:6d2af70c92ab | 40 | |
darienf | 20:6d2af70c92ab | 41 | ser.close() |