Hello everyone. I'm trying to measure my pulse with HW827 pulse sensor by using arduino nano.
#include <PulseSensorPlayground.h>
// PulseSensorPlayground object
PulseSensorPlayground pulseSensor;
// Constants
const int PulseWire = A1; // Replace A0 with the actual analog pin where the PulseSensor is connected
const int LED13 = 13; // On-board LED pin
const int Threshold = 550; // Set the threshold value based on your sensor readings
void setup() {
Serial.begin(9600);
pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13);
pulseSensor.setThreshold(Threshold);
if (pulseSensor.begin()) {
Serial.println("Sensor initialized");
}
}
void loop() {
int myBPM = pulseSensor.getBeatsPerMinute();
if (pulseSensor.sawStartOfBeat()) {
Serial.println("Heartbeat");
Serial.print("Heart Rate: ");
Serial.println(myBPM);
}
delay(200);
}
My code is above and I'm pretty sure that my connections are solid. Signal pin is connected to A1, Vcc is connected to 5V and - is connected to GND. I tried to uninstall the Arduino IDE and downloaded again. Whatever I tried, I could not debug the problem. The exit status 1 error is always on my screen.
what microcontroller are you using?
copy and upload the complete error message - select < CODE/ > and paste text where it says “type or paste code here”
Error Status 1
Shouldn't’ ‘stay’ on screen.
It will go away each time you press COMPILE or UPLOAD
and the source code will be reprocessed each time you press either of them.
If it goes away, then comes back, there’s probably an error in your code, or the upload configuration.
I use Arduino Nano.
and here is the whole error message
C:\Users\onury\AppData\Local\Temp\ccGyha9L.ltrans0.ltrans.o: In function `begin':
C:\Users\onury\OneDrive\Belgeler\Arduino\libraries\PulseSensor_Playground\src/PulseSensorPlayground.cpp:55: undefined reference to `PulseSensorPlayground::UsingInterrupts'
C:\Users\onury\OneDrive\Belgeler\Arduino\libraries\PulseSensor_Playground\src/PulseSensorPlayground.cpp:56: undefined reference to `PulseSensorPlaygroundSetupInterrupt()'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
it is always a good idea to have a look at the example programs which usually come with a library
run the programs - read the code to see how the examples work