sensors combination

can someone pls combine these two codes for me; sensor for heart rate and temperature sensor…tnkz…

#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
  double alpha = 0.75;
  int period = 20;
  double refresh = 0.0;
  
void setup() {
  pinMode(A0, INPUT);
  lcd.begin(16,2);
//lcd.backlight();//Uncomment when using a 12C
  lcd.clear();
  lcd.setCursor(0,0);
}

void loop() {
  static double oldValue = 0;
  static double oldrefresh = 0;

  int beat = analogRead(A0);

  double value = alpha*oldValue+(0-alpha)*beat;
  refresh = value-oldValue;


    lcd.setCursor(0,0);
    lcd.print("Heart Rate");
    lcd.setCursor(0,1);
    lcd.print("           ");
    lcd.setCursor(0,1);
    lcd.print(beat/10);
    oldValue = value;
    oldrefresh = refresh;
  delay(period*10);

and for temperature sensor:

#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int sensor = A1; // Assigning analog pin A1 to variable 'sensor'
float tempc; //variable to store temperature in Degree Celsius
float tempf; //variable to store temperature in Fahrenheit
float vout; //temporary variable to hold sensor reading

void setup() {
  pinMode(sensor, INPUT); // Configuring pin A1 as input
    Serial.begin(9600);
    lcd.begin(16,2);
  delay(500);

}

void loop() {
  vout = analogRead(sensor);
  vout = (vout*500)/1023;
  tempc = vout; // Storing value in Degree Celsius
  tempf = (vout*1.8)+32; // Converting to Fahrenheit
    lcd.setCursor(0,0);
    lcd.print("Degree C = ");
    lcd.print(tempc);
    lcd.setCursor(0,1);
    lcd.print("Fahrt. F = ");
    lcd.print(tempf);
  delay(1000); // Delay of 1 second for ease of viewing

}

Give it a try, and if you run into problems, post them according to “How to use this forum” guidelines.

Alternatively, you can post on the Gigs and Collaborations forum section. You may be asked to pay for the help.

Im all very new to this but cant you just leave them in 2 separate folders and then call each one in the main block. this is how I would attempt to do it. However I have only programmed using PLC ladder logic mainly.

Here is a tutorial page that may help you with combining codes.

Nobody can wave a magic wand and shout "Combine!" Both those programs use the LCD. How are they going to share that resource? Does one go first? Do you put one on each line? Then which one goes on which line?

It comes down to "What do you want it to do?" You are the magician with the power of Arduino. You can write a spell (sketch or whatever) and it will magically do what you want. If you get the spell wrong then it will do something else.