repo time
Dependencies: mbed MAX14720 MAX30205 USBDevice
HspGuiSourceV301/Script/hsp_registerread.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, 10000): |
darienf | 20:6d2af70c92ab | 10 | ser.write("/MAX30001/ReadReg 18\r".encode()) |
darienf | 20:6d2af70c92ab | 11 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 12 | #ser.write("/MAX30001/ReadReg 18\r".encode()) |
darienf | 20:6d2af70c92ab | 13 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 14 | #ser.write("/MAX30001/ReadReg 18\r".encode()) |
darienf | 20:6d2af70c92ab | 15 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 16 | #ser.write("/MAX30001/ReadReg 10\r".encode()) |
darienf | 20:6d2af70c92ab | 17 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 18 | #ser.write("/MAX30001/ReadReg 10\r".encode()) |
darienf | 20:6d2af70c92ab | 19 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 20 | #ser.write("/MAX30001/ReadReg 10\r".encode()) |
darienf | 20:6d2af70c92ab | 21 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 22 | #ser.write("/MAX30001/ReadReg 15\r".encode()) |
darienf | 20:6d2af70c92ab | 23 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 24 | #ser.write("/MAX30001/ReadReg 15\r".encode()) |
darienf | 20:6d2af70c92ab | 25 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 26 | #ser.write("/MAX30001/ReadReg 15\r".encode()) |
darienf | 20:6d2af70c92ab | 27 | #print(ser.readline()) |
darienf | 20:6d2af70c92ab | 28 | time.sleep(0.1) |
darienf | 20:6d2af70c92ab | 29 | print("Count " + str(x)) |
darienf | 20:6d2af70c92ab | 30 | |
darienf | 20:6d2af70c92ab | 31 | ser.close() |