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
+}