This script plots the heartrate collected via ANT+ dongle and compatible heartrate sensor. It can be run either directly as a python script or on Windows as an executable file.
If a settings.ini file does not exist in the executable or script directory it will be created on first run. The file contains several configurable parameters:
backgroundcolormatplotlib color for plot backgroundlinecolormatplotlib color for BPM linelabelscolormatplotlib color for labelsspinescolormatplotlib color for axesxptsnumber of datapoints displayed before X axis starts scrollingintervalmsinterval of funcanimation framesybottombottom y limitytoptop y limitwidthwindow width in inchesheightwindow height in inchesposxwindow x position in pixels from top-leftposywindow y position in pixels from top-left
This is built specifically for Windows. Simply double-click the plotter.exe file in the dist subdirectory.
These instructions will be given for python3 running on Linux.
- Install python3 and pip
- Create the virtual environment by entering the project folder and doing
python3 -m venv venv - Activate the virtual environment with
source venv/bin/activate - Install the requirements with
pip install -r requirements.txt - Run the script:
python3 plotter.py
Note that the required packages will be installed in the virtual environment subdirectory, .\venv\Lib\site-packages as shown in the pathex within plotter.spec. The script needs to package the libusb0 driver which should be located at C:\Windows\System32\libusb0.dll as shown in the datas within plotter.spec.
- Install python3, pip and pyinstaller
- Create the virtual environment by entering the project folder and doing
python -m venv venv - Activate the virtual environment with
venv\Scripts\activate - Install the requirements with
pip install -r requirements.txt - Build the executable by doing
pyinstaller plotter.spec(do not dopyinstaller plotter.pyas this will overwrite the .spec file, wiping out the pathex and data references explained above) - The resulting executable will land in the
.\builddirectory.
