user53887: I'm sharing my code.. The problem I am facing is that the code performs all the functions that are to be called except showing the MAX30100 (for heart rate) readings. I have tried this code using statement switches,cases, if-else but couldn't figure out.  Can anyone help me out regarding this?
    unsigned long runGSR() {          

total = total - readings[index];         // subtract the last reading:

 readings[index] = analogRead(inputPin);  // read from the sensor:

  delay(100);

  total = total + readings[index];       // add the reading to the total:

  index = index + 1;                     // advance to the next position in the 

array:

  if (index >= numReadings)               //when the end of the array is reached

    index = 0;                           // wrapped around to the beginning:


  average = total / numReadings;           // calculate the average:

  return average;       // send it to the computer as ASCII digits


    } 
    void ambtemp()    

    {

       reading = analogRead(A2);       //takes the reading from analogue pin 2

  tempVolts = reading * 5.0 / 1024.0;   //converts the readings to volts

  ambitemp = tempVolts / 0.01;        //output voltage /10 millivolts = 1 degree 
C

  Serial.print(",Ambient Temp:");      //prints ambient temperature in serial monitor

  Serial.println(ambitemp);

  delay(10);         

    }

    void hbt()    //Function for heart rate (MAX30100) in which I am having problem
    {
        do
        {
            pox.update(); // Make sure to call update as fast as possible
            if (millis() - tsLastReport > REPORTING_PERIOD_MS) {   //the loop repeats every second 
            lcd.clear();
            Serial.print("HR:");
            Serial.println(pox.getHeartRate()); //prints Heart rate on LCD 
            delay(100);
            ambtemp();    //calls the ambient temperature function
            gsr = runGSR();   //calls the GSR sensor function 
            delay(100);
            tsLastReport = millis();
        }


user34529: I assume you use this as source for your code:
This means that:
#include "MAX30100_PulseOximeter.h"
PulseOximeter pox;

Your issue is that the line:
Serial.println(pox.getHeartRate()); //prints Heart rate on LCD

Does not actually print anything on the LCD.
It only shows the value on the serial.
Try using lcd.print()

53887: <p>I'm sharing my code.. The problem I am facing is that the code performs all the functions that are to be called except showing the MAX30100 (for heart rate) readings. I have tried this code using statement switches,cases, if-else but couldn't figure out.  Can anyone help me out regarding this?</p>

<pre><code>    unsigned long runGSR() {          

total = total - readings[index];         // subtract the last reading:

 readings[index] = analogRead(inputPin);  // read from the sensor:

  delay(100);

  total = total + readings[index];       // add the reading to the total:

  index = index + 1;                     // advance to the next position in the 

array:

  if (index &gt;= numReadings)               //when the end of the array is reached

    index = 0;                           // wrapped around to the beginning:


  average = total / numReadings;           // calculate the average:

  return average;       // send it to the computer as ASCII digits


    } 
    void ambtemp()    

    {

       reading = analogRead(A2);       //takes the reading from analogue pin 2

  tempVolts = reading * 5.0 / 1024.0;   //converts the readings to volts

  ambitemp = tempVolts / 0.01;        //output voltage /10 millivolts = 1 degree 
C

  Serial.print(",Ambient Temp:");      //prints ambient temperature in serial monitor

  Serial.println(ambitemp);

  delay(10);         

    }

    void hbt()    //Function for heart rate (MAX30100) in which I am having problem
    {
        do
        {
            pox.update(); // Make sure to call update as fast as possible
            if (millis() - tsLastReport &gt; REPORTING_PERIOD_MS) {   //the loop repeats every second 
            lcd.clear();
            Serial.print("HR:");
            Serial.println(pox.getHeartRate()); //prints Heart rate on LCD 
            delay(100);
            ambtemp();    //calls the ambient temperature function
            gsr = runGSR();   //calls the GSR sensor function 
            delay(100);
            tsLastReport = millis();
        }
</code></pre>
 34529: <p>I assume you use <a href="https://github.com/oxullo/Arduino-MAX30100/blob/master/examples/MAX30100_Debug/MAX30100_Debug.ino" rel="nofollow noreferrer">this</a> as source for your code:</p>

<p>This means that:</p>

<pre><code>#include "MAX30100_PulseOximeter.h"
PulseOximeter pox;
</code></pre>

<p>Your issue is that the line:</p>

<pre><code>Serial.println(pox.getHeartRate()); //prints Heart rate on LCD
</code></pre>

<p>Does not actually print anything on the LCD.
It only shows the value on the serial.</p>

<p>Try using <a href="https://www.arduino.cc/en/Reference/LiquidCrystalPrint" rel="nofollow noreferrer"><code>lcd.print()</code></a></p>
