user30212: Let's say I have 2 loops LED() and IR() with a print statement in my Arduino loop() function. Basically I want my IR() loop to be always running so that at any point in time I provide a signal to the receiver, it will print something. I currently can only run LED() first and then once LED() is finished, only then the IR() will run. So if I send a signal let's say while LED() is running, nothing is showing up. Thanks!
EDIT: Updated with code
void loop() {
  single_Check(); // delay of 500ms
  if (irrecv.decode(&results)) {   //IR code
     Serial.println(results.value, HEX);
     irrecv.resume();
  }
}

The single_check() function basically turns on 6 LED one by one and check the voltage of the LED and prints them out. However, this code takes time to finish because I put in delay(500). So only after 500ms, the IR code will run.

user30340: Arduino and like Arduino hardware run only a sequential Flow, Because they usually have only one core.
For running 2 loops side-by-side you have some solutions.

A flow to test flags and execute specific code.
Use a timer
Use a RealTime OS, like FreeRTOS

try never use delay

30212: <p>Let's say I have 2 loops <code>LED()</code> and <code>IR()</code> with a print statement in my Arduino <code>loop()</code> function. Basically I want my <code>IR()</code> loop to be always running so that at any point in time I provide a signal to the receiver, it will print something. I currently can only run <code>LED()</code> first and then once <code>LED()</code> is finished, only then the <code>IR()</code> will run. So if I send a signal let's say while <code>LED()</code> is running, nothing is showing up. Thanks!</p>

<p>EDIT: <strong>Updated with code</strong></p>

<pre><code>void loop() {
  single_Check(); // delay of 500ms
  if (irrecv.decode(&amp;results)) {   //IR code
     Serial.println(results.value, HEX);
     irrecv.resume();
  }
}
</code></pre>

<p>The <code>single_check()</code> function basically turns on 6 LED one by one and check the voltage of the LED and prints them out. However, this code takes time to finish because I put in <code>delay(500)</code>. So only after 500ms, the IR code will run.</p>
 30340: <p>Arduino and like Arduino hardware run only a sequential Flow, Because they usually have only one core.
For running 2 loops side-by-side you have some solutions.</p>

<ul>
<li>A flow to test flags and execute specific code.</li>
<li>Use a timer</li>
<li>Use a RealTime OS, like <a href="http://www.freertos.org/" rel="nofollow noreferrer">FreeRTOS</a></li>
</ul>

<p>try never use delay</p>
