Guest User

Untitled

a guest
May 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. const int PULSE_SENSOR_COUNT = 2;
  2. const int PulseWire = A0;
  3. const int PulseWire2 = A1;
  4. const int LED13 = 13;
  5. int Threshold = 550;
  6. void setup() {
  7. Serial.begin(9600);
  8. pulseSensor.analogInput(PulseWire,0);
  9. pulseSensor.analogInput(PulseWire2,1);
  10. pulseSensor.blinkOnPulse(LED13);
  11. pulseSensor.setThreshold(Threshold);
  12. if (pulseSensor.begin()) {
  13. }
  14.  
  15. void loop() {
  16.  
  17. int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our
  18. pulseSensor object that returns BPM as an "int".
  19.  
  20. if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if "a
  21. beat happened".
  22. //Serial.println("♥ A HeartBeat Happened ! "); // If test is "true", print a
  23. message "a heartbeat happened".
  24. Serial.print("BPM1: "); // Print phrase "BPM: "
  25. Serial.println(myBPM); // Print the value inside of
  26. myBPM.
  27. }
  28.  
  29.  
  30.  
  31. delay(20); // considered best practice in a simple sketch.
  32.  
  33. }
Add Comment
Please, Sign In to add comment