user34614: I have two different programs written for my Arduino. One checks the room temperature every 5 seconds. The other one looks for IR remote signals.
I would love to combine those 2 programs, yet the problem is the delay from the room temperature sketch.
If I would combine them. it means my IR script won't be working for a full 5 seconds (because of the delay of the room temperature script) then it will be able to receive a fraction of a second and then the temperature sketch goes again.
#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led = 12;
const int inPin = 0;

void setup() {
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  Serial.begin(9600);
  irrecv.enableIRIn();
}

void loop() {
  int value = analogRead(inPin);
  float millivolts = (value / 1024.0 ) * 5000;
  float celsius = millivolts / 10;
  Serial.println(celsius, 1);
  delay(5000);
  if(irrecv.decode(&results)) {
    //this checks to see if a code has been received
    if(results.value == 0xFF6897) {
      //if the button press equals the hex value 0xC284
        digitalWrite(led, HIGH);
        // turn the LED on (HIGH is the voltage level)
        delay(1000); // wait for a second
        digitalWrite(led, LOW);
        // turn the LED off by making the voltage LOW
        delay(1000); // wait for a second//do something useful here
    }
    irrecv.resume(); //receive the next value
  }
}

Does anyone know how to keep the IR part active and the temperature measure every 5 seconds, and do this simultaneously?
Or do I need another Arduino?

user30005: 
does anyone know how to keep ...

think about ways to conditionalize execution on time elapsed. I showed a short while ago ways to construct a software timer and you may want to look into that.

user-1: EDIT: Modify the code according @Edgar's comment.
Check this alternative. The idea is executing code every 5 and 1 seconds.
The blink is true when you need the LED blinking. I don't know how long will you need to keep it blinking, but this keeps it as long as results.value keep being equals to 0xFF6897. 
#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led = 12;
const int inPin = 0;

void setup() {
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  Serial.begin(9600);
  irrecv.enableIRIn();
}

void loop() {
  static boolean blink = false;
  static unsigned long startTemp = 0;
  static unsigned long startBlink = 0;
  unsigned long msTime = millis();

  //  Check for room temp every 5 seconds.
  if (msTime - startTemp >= 5000) {
    startTemp = msTime;
    int value = analogRead(inPin);
    float millivolts = (value / 1024.0 ) * 5000;
    float celsius = millivolts / 10;
    Serial.println(celsius, 1);
  }

  //  Blink every 1 second
  if (msTime - startBlink >= 1000 && blink) {
    startBlink = msTime;
    int state = digitalRead(led);
    digitalWrite(led, !state);
    //  Change blink to stop blinking after one pass (HIGH/LOW).
    //  Modify if you need to keep blinking for longer time.
    blink = (state == LOW);    
  }

  if(irrecv.decode(&results)) {
    blink = (results.value == 0xFF6897);        
    irrecv.resume(); //receive the next value
  }
}


34614: <p>I have two different programs written for my Arduino. One checks the room temperature every 5 seconds. The other one looks for IR remote signals.</p>

<p>I would love to combine those 2 programs, yet the problem is the delay from the room temperature sketch.</p>

<p>If I would combine them. it means my IR script won't be working for a full 5 seconds (because of the delay of the room temperature script) then it will be able to receive a fraction of a second and then the temperature sketch goes again.</p>

<pre><code>#include &lt;IRremote.h&gt;

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led = 12;
const int inPin = 0;

void setup() {
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  Serial.begin(9600);
  irrecv.enableIRIn();
}

void loop() {
  int value = analogRead(inPin);
  float millivolts = (value / 1024.0 ) * 5000;
  float celsius = millivolts / 10;
  Serial.println(celsius, 1);
  delay(5000);
  if(irrecv.decode(&amp;results)) {
    //this checks to see if a code has been received
    if(results.value == 0xFF6897) {
      //if the button press equals the hex value 0xC284
        digitalWrite(led, HIGH);
        // turn the LED on (HIGH is the voltage level)
        delay(1000); // wait for a second
        digitalWrite(led, LOW);
        // turn the LED off by making the voltage LOW
        delay(1000); // wait for a second//do something useful here
    }
    irrecv.resume(); //receive the next value
  }
}
</code></pre>

<p>Does anyone know how to keep the IR part active and the temperature measure every 5 seconds, and do this simultaneously?</p>

<p>Or do I need another Arduino?</p>
 30005: <blockquote>
  <p>does anyone know how to keep ...</p>
</blockquote>

<p>think about ways to conditionalize execution on time elapsed. I showed a short while ago ways to construct a software timer and you may want to look into that.</p>
 -1: <p><strong>EDIT:</strong> Modify the code according @Edgar's comment.</p>

<p>Check this alternative. The idea is executing code every 5 and 1 seconds.
The <code>blink</code> is true when you need the LED blinking. I don't know how long will you need to keep it blinking, but this keeps it as long as <code>results.value</code> keep being equals to 0xFF6897. </p>

<pre><code>#include &lt;IRremote.h&gt;

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led = 12;
const int inPin = 0;

void setup() {
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  Serial.begin(9600);
  irrecv.enableIRIn();
}

void loop() {
  static boolean blink = false;
  static unsigned long startTemp = 0;
  static unsigned long startBlink = 0;
  unsigned long msTime = millis();

  //  Check for room temp every 5 seconds.
  if (msTime - startTemp &gt;= 5000) {
    startTemp = msTime;
    int value = analogRead(inPin);
    float millivolts = (value / 1024.0 ) * 5000;
    float celsius = millivolts / 10;
    Serial.println(celsius, 1);
  }

  //  Blink every 1 second
  if (msTime - startBlink &gt;= 1000 &amp;&amp; blink) {
    startBlink = msTime;
    int state = digitalRead(led);
    digitalWrite(led, !state);
    //  Change blink to stop blinking after one pass (HIGH/LOW).
    //  Modify if you need to keep blinking for longer time.
    blink = (state == LOW);    
  }

  if(irrecv.decode(&amp;results)) {
    blink = (results.value == 0xFF6897);        
    irrecv.resume(); //receive the next value
  }
}
</code></pre>
