const int pulsePin = A0; int threshold = 515; // When the readings go above this number, it "counts" as a heartbeat void setup() { Serial.begin(9600); } void loop() { int signal = analogRead(pulsePin); Serial.print(signal); // This prints the value of the incoming signal. Serial.print(","); Serial.println(threshold); // This prints the minimum value to "count" a heartbeat delay(50); }