Combining code problems

I am trying to get the my code where if the temp sensore prints “person present” then it starts the temperature sensor up. Help!

#include <WireExt.h>

// TEMP:
int reader ;
void temp_setup() {
//put your setup code here to run once:
Serial.begin(9600);
pinMode(10 , OUTPUT);
}

void temp_loop() {
//put your main code here, to run repeatedly:
reader = analogRead(A0);// 0 - 1023
int mV = reader *(5000 / 1024 );
float C = (mV - 500 ) / 10 ;
float F = C * 9.0 / 5.0 + 32 ;

Serial.println(F);
if (F > 30.0 && F <40.0){
alarm1();
} else if (F > 40.0 && F <50.0){
alarm2();
} else if (F > 50.0 && F <75.0){
alarm3();
}
}

// This is the lowest level alarm sound
void alarm1() {
analogWrite(10 , 20 ); // 1 - 254
delay (50);
analogWrite(10 , 0);// attempting to make a sound
delay (50);
Serial.println(“alarm 1”);
}
// This is the second level alarm sound
void alarm2() {
analogWrite(10 , 20 ); // 1 - 254
delay (500);
analogWrite(10 , 0);// attempting to make a sound
delay (500);
Serial.println(“alarm 2”);
}
// This is the third level alarm sound
void alarm3() {
analogWrite(10 , 20 ); // 1 - 254
delay (5000);
analogWrite(10 , 0);// attempting to make a sound
delay (5000);
Serial.println(“alarm 3”);
}

//Infrared:
// Code from Arduino Forum https://forum.arduino.cc/index.php?topic=217394.0
// Modified to a Serial Output

#include <Wire.h>
#include “WireExt.h”

#define D6T_addr 0x0A // Address of OMRON D6T is 0x0A in hex
#define D6T_cmd 0x4C // Standard command is 4C in hex

int rbuf[35]; // Actual raw data is coming in as 35 bytes. Hence the needed for WireExt so that we can handle more than 32 bytes
int tdata[16]; // The data comming from the sensor is 16 elements, in a 16x1 array
float t_PTAT;

void infrared_setup()
{
Wire.begin();
Serial.begin(9600);

pinMode(13, OUTPUT);
}

void infrared_loop()
{
int i;

Wire.beginTransmission(D6T_addr);
Wire.write(D6T_cmd);
Wire.endTransmission();

if (WireExt.beginReception(D6T_addr) >= 0) {
i = 0;
for (i = 0; i < 35; i++) {
rbuf = WireExt.get_byte();

  • }*
  • WireExt.endReception();*
    t_PTAT = (rbuf[0] + (rbuf[1] << 8)) * 0.1; // Unclear what this is used for. It’s not called elsewhere
  • for (i = 0; i < 16; i++) {*
    tdata = (rbuf[(i * 2 + 2)] + (rbuf[(i * 2 + 3)] << 8)) * 0.1;
    * }*
    * }*
    * // Data is captured into tdata. This should be a 16x1 data. For now we can output as a csv string which we can import to Matlab to sequence*
    * for (i = 0; i < 4; i++) {*
    _ Serial.print(tdata*);
    Serial.print(",");
    }
    Serial.print("\n");
    // Data is captured into tdata. This should be a 4x1 data. For now we can output as a csv string which we can import to Matlab to sequence*
    * for (i = 4; i < 8; i++) {
    Serial.print(tdata);
    Serial.print(",");
    }
    Serial.print("\n");
    // Data is captured into tdata. This should be a 4x1 data. For now we can output as a csv string which we can import to Matlab to sequence*

    * for (i = 8; i < 12; i++) {
    Serial.print(tdata);
    Serial.print(",");
    }
    Serial.print("\n");
    // Data is captured into tdata. This should be a 4x1 data. For now we can output as a csv string which we can import to Matlab to sequence*

    * for (i = 12; i < 16; i++) {
    Serial.print(tdata);
    Serial.print(",");
    }
    Serial.print("\n");
    Serial.print("\n");
    int CurrentLowestTemp = 999;
    int CurrentHighestTemp = 0;
    for (int i = 0; i < 16; i++) {
    if (tdata < CurrentLowestTemp) {
    CurrentLowestTemp = tdata;
    }
    }
    Serial.print("CurrentLowest: ");
    Serial.println(CurrentLowestTemp);*_

* for (int i = 0; i < 16; i++) {*
_ if (tdata > CurrentHighestTemp) {
CurrentHighestTemp = tdata*;
}
}
Serial.print("CurrentHighest: ");
Serial.println(CurrentHighestTemp);*_

* // (“TempDiff”)*
* int TempDiff = CurrentHighestTemp - CurrentLowestTemp;*
* Serial.print("TempDiff: ");*
* Serial.print(TempDiff);*
* Serial.println();*
* if (TempDiff > 0 && TempDiff < 4) {*
* Serial.print(“Person Not Present”);*
* } else if (TempDiff >= 4) {*
* Serial.print(“Person Present”);*

* delay(4000);*
* }*
}
//COMBINED CODE:
void setup(){
* infrared_setup();
temp_setup();
_}
void loop()
{*_

infrared_loop();
temp_loop();

}

}

....and that's why we ask you to use code tags.
Do you remember typing all those italics?
No, I thought not.

Please edit your post.