Exit status 1 error

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.

You started a topic in the Uncategorised category of the forum

Your topic has been moved to a relevant category

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

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”

Did you test your setup with one of the example-code provided by Sensorplayground?
f.e. this one:

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

think you may need to add a line before the #include

#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>

Yes it worked when I add the "#define USE_ARDUINO_INTERRUPTS true" line before the #include. Thanks a lot!

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.