~alienagain/heart_rate

e98a6227a0420a3df6f84162575bd4b280be6ed0 — terceranexus6 2 years ago master
adding ino
1 files changed, 36 insertions(+), 0 deletions(-)

A src/heart_monitor.ino
A  => src/heart_monitor.ino +36 -0
@@ 1,36 @@
  /*
  AD8232-ECG-Sensor-Module
  modified on 09 Feb 2021
  by Amir Mohammad Shojaee @ Electropeak
  Home

*/


void setup() {
// initialize the serial communication:
Serial.begin(9600);
Serial.println("#RUN");
pinMode(10, INPUT); // Setup for leads off detection LO +
pinMode(11, INPUT); // Setup for leads off detection LO -
 
}
 
void loop() {
 
if((digitalRead(10) == 1)||(digitalRead(11) == 1)){
//Serial.println('!');
}
else{
// send the value of analog input 0:

Serial.println(analogRead(A0)/10);
if( analogRead(A0)/10 > 36){
  Serial.println("heart rate high");
  }else{
    Serial.println("heart rate normal");
    }
delay(500);
}
//Wait for a bit to keep serial data from saturating
}