This is the latest working repository used in our demo video for the Maxim to display temperature readings on Bluetooth
hspguisourcev301/HspGuiSourceV301/Script/hsp_registerread.py@5:bc128a16232f, 2021-05-02 (annotated)
- Committer:
- darienf
- Date:
- Sun May 02 23:09:04 2021 +0000
- Revision:
- 5:bc128a16232f
- Parent:
- 3:36de8b9e4b1a
This is the program that was last used, that has the working temperature and some comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
darienf | 3:36de8b9e4b1a | 1 | import serial |
darienf | 3:36de8b9e4b1a | 2 | import io |
darienf | 3:36de8b9e4b1a | 3 | import time |
darienf | 3:36de8b9e4b1a | 4 | |
darienf | 3:36de8b9e4b1a | 5 | ser = serial.Serial(port='com16', baudrate=9600, timeout=1) |
darienf | 3:36de8b9e4b1a | 6 | |
darienf | 3:36de8b9e4b1a | 7 | ser.isOpen() |
darienf | 3:36de8b9e4b1a | 8 | |
darienf | 3:36de8b9e4b1a | 9 | for x in range (0, 10000): |
darienf | 3:36de8b9e4b1a | 10 | ser.write("/MAX30001/ReadReg 18\r".encode()) |
darienf | 3:36de8b9e4b1a | 11 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 12 | #ser.write("/MAX30001/ReadReg 18\r".encode()) |
darienf | 3:36de8b9e4b1a | 13 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 14 | #ser.write("/MAX30001/ReadReg 18\r".encode()) |
darienf | 3:36de8b9e4b1a | 15 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 16 | #ser.write("/MAX30001/ReadReg 10\r".encode()) |
darienf | 3:36de8b9e4b1a | 17 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 18 | #ser.write("/MAX30001/ReadReg 10\r".encode()) |
darienf | 3:36de8b9e4b1a | 19 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 20 | #ser.write("/MAX30001/ReadReg 10\r".encode()) |
darienf | 3:36de8b9e4b1a | 21 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 22 | #ser.write("/MAX30001/ReadReg 15\r".encode()) |
darienf | 3:36de8b9e4b1a | 23 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 24 | #ser.write("/MAX30001/ReadReg 15\r".encode()) |
darienf | 3:36de8b9e4b1a | 25 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 26 | #ser.write("/MAX30001/ReadReg 15\r".encode()) |
darienf | 3:36de8b9e4b1a | 27 | #print(ser.readline()) |
darienf | 3:36de8b9e4b1a | 28 | time.sleep(0.1) |
darienf | 3:36de8b9e4b1a | 29 | print("Count " + str(x)) |
darienf | 3:36de8b9e4b1a | 30 | |
darienf | 3:36de8b9e4b1a | 31 | ser.close() |