Issue
I'm trying to assess if an Oximeter plugged in via USB is correctly collecting heart rate data. I am using the Systole package, and some pre-writtend code sourced here (Scroll down to Recording PPG Signal :Recording PPG Signal code
I am having 2 errors, the first is:SerialException: could not open port 'COM4': PermissionError(13, 'Access is denied.', None, 5)
And the second is:TypeError: plot_raw() got an unexpected keyword argument 'show_heart_rate'
The script I am trying to run:
from systole.recording import Oximeter
#Option for usin a simulated device, which I am not doing
from systole import serialSim
# Use a USB device
import serial
ser = serial.Serial("COM4") # Use this line for USB recording
#Plotting
oxi = Oximeter(serial=ser).setup().read(duration=10)
oxi.plot_raw(show_heart_rate=True, figsize=(13, 8))
Below is my desired output:
Solution
like I said in a comment the error 'COM4': PermissionError(13, 'Access is denied.', None, 5)
means that the COM port is already taken by another program.
I think that the second error is because of this line:
oxi = Oximeter(serial=ser).setup().read(duration=10)
according to systole
api documentation you are supposed to do:
# ................................
oxi = Oximeter(serial=ser)
oxi.setup()
oxi.read(duration=10)
# ................................
oxi.plot_raw(show_heart_rate=True, figsize=(13, 8))
Answered By - Omer Dagry
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.