Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to simply get a numeric BPM #29

Closed
SparkMike77 opened this issue Dec 22, 2017 · 7 comments
Closed

Is there a way to simply get a numeric BPM #29

SparkMike77 opened this issue Dec 22, 2017 · 7 comments

Comments

@SparkMike77
Copy link

I'm looking for how to just pull the BPM number, not plot it on a graph but all the BPM sketches have a graphing output.

I'm assuming instead of calling pulseSensor.outputBeat() there's a way just to call for the numeric BPM?

@joelSensor
Copy link
Member

There is a way to just get BPM number.
Please check out the PulseSensor Playground Tools
https://github.com/WorldFamousElectronics/PulseSensorPlayground/blob/master/resources/PulseSenaor%20Playground%20Tools.md

a call to getBeatsPerMinute() will return the latest BPM value (int). You can simply comment out the call to pulseSensor.outputBeat() and just do you own thing instead.

@yury-g
Copy link
Member

yury-g commented Jan 10, 2018

SparkMike77,
I drafted some code here for you. It's not pretty, but it does the behavior you requested.
Try this code in a new Sketch, or just run it as an ".ino" file in Arduino.
https://github.com/yury-g/ReadMePlayground/blob/master/PulseSensor_BPM_Serial_Print.ino

This is a screengrab of it working correctly:
Let me know if it helps!
pulsesensor_bpm_code_screengrab

@yury-g
Copy link
Member

yury-g commented Jan 13, 2018

Mike,
Try the sketch at this link. It is BPM and BPM-only via our new Library. ; )

https://github.com/WorldFamousElectronics/PulseSensorPlayground/blob/master/examples/Getting_BPM_to_Monitor/Getting_BPM_to_Monitor

@yury-g yury-g closed this as completed Jan 13, 2018
@SparkMike77
Copy link
Author

Thanks Guys, I had completely forgotten to check back and was hammering on my own library (really poorly). This looks exactly like what I need!

@haarers
Copy link

haarers commented Jul 18, 2018

Is there somewhere that I can see the code for the function

getBeatsPerMinute()

Thanks!

@biomurph
Copy link
Contributor

The actual function is pretty simple, and it's on line 87 here
https://github.com/WorldFamousElectronics/PulseSensorPlayground/blob/master/src/utility/PulseSensor.cpp

The function that determines BPM is called processLatestSample, on line 122 of the same file.

@biomurph biomurph reopened this Jul 18, 2018
@haarers
Copy link

haarers commented Jul 18, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants