This is the latest working repository used in our demo video for the Maxim to display temperature readings on Bluetooth

Dependencies:   USBDevice

hspguisourcev301/HspGuiSourceV301/Script/hsp_intassignment.py

Committer:
darienf
Date:
2021-05-02
Revision:
5:bc128a16232f
Parent:
3:36de8b9e4b1a

File content as of revision 5:bc128a16232f:

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()