Comments (3)
@tandroutsou, I didn't write the original code, I only adapted it for the Particle devices. You might want to explore the PulseSensor site for more information.
from pulsesensor_spark.
@pkourany thanks for your answer! Do you think that the following part should also be adapted (2048 instead of 512)? Because in the other places these values have been changed.
if (N > 2500){ // if 2.5 seconds go by without a beat
thresh = 512; // set thresh default
P = 512; // set P default
T = 512; // set T default
lastBeatTime = sampleCounter; // bring the lastBeatTime up to date
firstBeat = true; // set these to avoid noise
secondBeat = false; // when we get the heartbeat back
}
from pulsesensor_spark.
@tandroutsou, I believe setting the values to 2048 at the start is meant to cause the algorithm to fire and eventually get to the (N > 2500) statement which then resets the values to 512.
You may want to adjust the values up or down from 512 to see how the sensor responds. I am not sure why the code would not work after not using the sensor for some time. What else is your code doing?
One thing you might want to consider is using a MAX30102 pulse-oximeter sensor. It uses I2C and there are libraries available for the Particle devices in the Web IDE and Workbench and CLI.
from pulsesensor_spark.
Related Issues (6)
- 'SysInterrupt_TIM3_Update' was not declared in this scope HOT 2
- 'SysInterrupt_TIM2' was not declared in this scope HOT 1
- 'SysInterrupt_TIM3' was not declared in this scope
- SparkIntervalTimer/SparkIntervalTimer.h: No such file or directory HOT 3
- Particle framework now also features a `Signal` class HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulsesensor_spark.