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:
backgroundcolor
matplotlib color for plot backgroundlinecolor
matplotlib color for BPM linelabelscolor
matplotlib color for labelsspinescolor
matplotlib color for axesxpts
number of datapoints displayed before X axis starts scrollingintervalms
interval of funcanimation framesybottom
bottom y limitytop
top y limitwidth
window width in inchesheight
window height in inchesposx
window x position in pixels from top-leftposy
window 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.py
as this will overwrite the .spec file, wiping out the pathex and data references explained above) - The resulting executable will land in the
.\build
directory.