This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

interfacing an analog device to the nrf52

I am trying to connect an lcup heart rate sensor which is an analog device . i am using the SAADC example t interface it to the NRF52 board, but iam not getting the expected values.ow to congigure it for the lcup heart rate sensor

Parents Reply Children
  • actually i am getting raw values from the sensor,,i mistook it as BPM vaiues,

    i have changed the raw values to the BPM.

    pass the raw values to this function ,,

    it wil give BPM

    by using this code

    void data_convert(uint16_t a)
    {
    	double alpha = 0.75;
    static double oldValue = 0;
    static double oldChange = 0;
    int rawValue = a;
    float voltage = rawValue * (5.0 / 1023.0);
    double BPM = alpha * oldValue + (1 - alpha) * rawValue;
    	NRF_LOG_INFO("%d\n",BPM);
    
    }

Related