const int pulseSensorPin = A0; // Analog pin where the Pulse Sensor is connected
void setup() {
Serial.begin(115200); // Initialize serial communication
pinMode(pulseSensorPin, INPUT); // Set the pulse sensor pin as input
}
void loop() {
int sensorValue = analogRead(pulseSensorPin); // Read the analog value from the sensor
float heartRate = map(sensorValue, 0, 4095, 60, 100); // Map the sensor value to a heart rate range
Serial.print("Heart Rate (Simulated): ");
Serial.println(heartRate);
delay(1000); // Delay between readings
}