LED convertion to number

Hi, I have posted before and I'm very confused. I have done some research and I can't find the answer I'm looking for.

I have an ECG device (I made it myself) where I'm trying to used the LED information to show up as a number on my LCD display. Meaning: everytime is on, I need to read that and convert it into a number, every 30 seconds, so I can calculate my BPM.

I'm not sure which function I should use, I'm using this:

duration = pulseIn(pin= HIGH);

  while (pulseIn= HIGH){
    calculation= duration+1;
     delay (30000);
     calculation= duration+1;  

        BPM= calculation *2; 

But apparently it's not right.

This is the error I'm getting

\Arduino15\packages\arduino\hardware\avr\1.8.3\cores\arduino/Arduino.h:40:14: error: assignment of function 'long unsigned int pulseIn(uint8_t, uint8_t, long unsigned int)'
 #define HIGH 0x1

calling a function is not done that way...

usually the first thing to do is to read the doc

  duration = pulseIn(pin, HIGH);

what do you expect from

while (pulseIn= HIGH){

pulseIn is a function name and you are trying to assign the value HIGH to it...

I had it like that and I changed it and I forgot to put it back.

from while (pulseIn= HIGH){ I need to create a calculation to add the numbers of how many times the LED is in the HIGH position. I don't know if it's clear

I got the answer, thanks for helping!

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