Giter VIP home page Giter VIP logo

lib-maxim-max30101's Introduction

Forking Zerynth code to run this from a raspberry pi and remove reference to the rest of zerynth's code

max30101.py is the library, example.py is an example of how to run it and get data

Main library usage: Basically create an instance of the class, init it, set up the interrupt & set up something to process the interrupt. NB you either need to set up the interrupt handler before initialising the max30101 or read the interrupts straight away to clear the pin.

Example.py Goes through the steps above to set up the interrupt and initialise the max30101

ppgLoop.py ppgLoop will mimic the output of the raspberrry pi - continuously dumping data to a csv file in batches of 17 samples every 68ms. The source for the data and output file can be specified using --ipfile and --opfile There are 2 example csv files, one has 2 breath holding events and i had my finger on the whole time. The other i didn't have my finger on until a few seconds into the recording

Raspberry pi setup: This setup is referred to max30101 on a Heartrate 4 click board connected to raspberry pi i2c pins sda - 3 & scl - 5), interrupt on pin 26, 3.3V & 5V from appropriate pins

enable i2c: sudo raspi-config then navigate to interfaces and enable it (may need to restart)

install i2c tools sudo apt-get install i2c-tools

wire the board up and test whether communication is happening: i2cdetect -y 1

get the necessary python packages:

pip install smbus2 csv gpiozero argparse pyqt5

We need the dev branch of pyqtgraph otherwise you get an error about time not having a clock function (python 3.8 removed that function). Best way is to if you have pyqtgraph already - uninstall it with pip uninstall pyqtgraph then get the latest pyqtgraph: git clone git clone https://github.com/pyqtgraph/pyqtgraph.git in the repo directory run python setup.py install

lib-maxim-max30101's People

Contributors

ilw avatar zerynth avatar

Watchers

Harry Davies avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.