Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int PULSE_SENSOR_COUNT = 2;
- const int PulseWire = A0;
- const int PulseWire2 = A1;
- const int LED13 = 13;
- int Threshold = 550;
- void setup() {
- Serial.begin(9600);
- pulseSensor.analogInput(PulseWire,0);
- pulseSensor.analogInput(PulseWire2,1);
- pulseSensor.blinkOnPulse(LED13);
- pulseSensor.setThreshold(Threshold);
- if (pulseSensor.begin()) {
- }
- void loop() {
- int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our
- pulseSensor object that returns BPM as an "int".
- if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if "a
- beat happened".
- //Serial.println("♥ A HeartBeat Happened ! "); // If test is "true", print a
- message "a heartbeat happened".
- Serial.print("BPM1: "); // Print phrase "BPM: "
- Serial.println(myBPM); // Print the value inside of
- myBPM.
- }
- delay(20); // considered best practice in a simple sketch.
- }
Add Comment
Please, Sign In to add comment