ayuda funciones en paralelo

antes que nada agradezco el tiempo que le dedicaran a la lectura de este problema .
soy principiante en el entorno arduino y estoy intentando realizar lo siguiente..

control de reles por medio de un ehternet shield, un lector de temperatura con dth 11 que muestra la temperatura y la humedad en un lcd conectado de forma I2C la idea de esto es hacer un panel de control para una casa semiautomática, donde el control por Internet seria el panel de control manual ,

planeo meter también un sensor de pir el cual active una salida mientras detecte movimiento
y que de manera automática el sensor de temperatura active o desactive una salida cuando llegue a determinada temperatura , pero no tengo idea de como hacerlo ;

en este código tengo algo básico con el modulo de Internet y el sensor mas sin embargo al anexarle algún código mas como es una secuencia la parte de Internet tiene que esperar a que se termine de ejecutar el resto del código y tarda en reaccionar

mis preguntas son : hay alguna forma de hacer que las funciones se ejecuten en paralelo y no en serie??

y si alguien me pudiera orientar con la parte de controlar una salida cuando llegue a un limite superior de temperatura y desactivarlo al limite inferior

este es el código que tengo hasta ahora :

#include <Wire.h>   // Libreria de protocolo i2c
#include <LiquidCrystal_I2C.h> // Libreria de Convertidor LCD-i2c
LiquidCrystal_I2C lcd(0x27,16,2);
#include "DHT.h" 
#define DHTPIN 6 // cambio de pin por cuestion de choque  
#define DHTTYPE DHT11 
DHT dht(DHTPIN, DHTTYPE); 

byte charGrado[8] = 
{ 0b01110,
  0b01010,
  0b01110,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000};

#include <SPI.h> 
#include <Ethernet.h>

byte mac[]={0xDE,0xAD,0xBE,0xEF,0xFE,0xED}; //MAC 
IPAddress ip(192,168,0,20); //IP 192.168.0.254
EthernetServer servidor(80); 

int rele1=2; int rele2=3; int rele3=4; int rele4 =5;

String readString=String(30);
String estado1=String(3);String estado2=String(3);String estado3=String(3);String estado4=String(3);

void setup(){
Ethernet.begin(mac, ip); 
servidor.begin(); 
pinMode(rele1,OUTPUT); digitalWrite(rele1,HIGH);
pinMode(rele2,OUTPUT); digitalWrite(rele2,HIGH);
pinMode(rele3,OUTPUT); digitalWrite(rele3,HIGH);
pinMode(rele4,OUTPUT); digitalWrite(rele4,HIGH);

estado1="OFF";estado2="OFF";estado3="OFF";estado4="OFF";

lcd.init();//inicia la lcd
  dht.begin();//se inicia el sensor
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("INICIANDO ...");
  delay(1000);
  lcd.clear();
  
  lcd.createChar(0, charGrado);//llama el caracter °
}

void loop(){ 
  
  //inica lector de temperatura 
int h = dht.readHumidity(); //se lee la humedad
int t= dht.readTemperature(); // se lee la temperatura
lcd.backlight();
lcd.setCursor(0,0);
  lcd.print("HUMEDAD:");
  lcd.print( h);
  lcd.print("%");
  
 lcd.setCursor(0,1);
 lcd.print("TEMPERTURA:");
 lcd.print(t);
  lcd.write(byte(0)); 
  lcd.print("C");

  // se imprime las variables de temperatura y humedad
 // delay(10000); 
  //lcd.clear();
  //lcd.print("ESCANEANDO...");
  //delay (12000);
  //lcd.clear();

 //termina lector de temperatura 
// control manual empieza aqui...
  EthernetClient cliente= servidor.available(); 
if(cliente) {
boolean lineaenblanco=true; 
while(cliente.connected()) {
if(cliente.available()) {
char c=cliente.read(); 
if(readString.length()<30) {
readString.concat(c);
} 
if(c=='\n' && lineaenblanco) 
{
int LED1 = readString.indexOf("LED1="); 
int LED2 = readString.indexOf("LED2="); 
int LED3 = readString.indexOf("LED3="); 
int LED4 = readString.indexOf("LED4="); 


if(readString.substring(LED1,LED1+6)=="LED1=T") {digitalWrite(rele1,LOW);
estado1="ON";}
if (readString.substring(LED1,LED1+6)=="LED1=F") {digitalWrite(rele1,HIGH); 
estado1="OFF";}

if (readString.substring(LED2,LED2+6)=="LED2=T") {digitalWrite(rele2,LOW);
estado2="ON"; } 
if (readString.substring(LED2,LED2+6)=="LED2=F") {digitalWrite(rele2,HIGH); 
estado2="OFF";}

if(readString.substring(LED3,LED3+6)=="LED3=T") {digitalWrite(rele3,LOW);
estado3="ON"; } 
if (readString.substring(LED3,LED3+6)=="LED3=F") {digitalWrite(rele3,HIGH); 
estado3="OFF";}

if(readString.substring(LED4,LED4+6)=="LED4=T") {digitalWrite(rele4,LOW);
estado4="ON"; } 
if (readString.substring(LED4,LED4+6)=="LED4=F") {digitalWrite(rele4,HIGH); 
estado4="OFF";}

cliente.println("HTTP/1.1 200 OK"); 
cliente.println("Content-Type: text/html"); 
cliente.println("Connection: close");
cliente.println("Refresh: ");  
cliente.println(); 
cliente.println("<!DOCTYPE HTML>");
cliente.println("<html>"); 
cliente.println("<head>"); 
cliente.println("<title>CONTROL MANUAL</title>"); 
cliente.println("</head>");

cliente.println("<body>");
cliente.println("<body bgcolor=#819FF7 height=150% width=150%>");
cliente.println("<center>"); 
cliente.println("<h1>PANEL DE CONTROL MANUAL</h1>");
cliente.println("<h2>PROTOTIPO DE SALON INTELIGENTE</h2>");

cliente.print("ILUMINACION");
cliente.print("
");
cliente.println("<input type=submit value=ENCENDIDO style=width:150px;height:100px onClick=location.href='./?LED1=T\'><input type=submit value=APAGADO style=width:150px;height:100px onClick=location.href='./?LED1=F\'>"); 
cliente.println("STATUS=");  cliente.println(estado1);  cliente.print("<p>&nbsp;</p>");  


cliente.print("VENTILADORES");
cliente.print("
");
cliente.println("<input type=submit value=ENCENDIDO style=width:150px;height:100px onClick=location.href='./?LED2=T\'><input type=submit value=APAGADO style=width:150px;height:100px onClick=location.href='./?LED2=F\'>"); 
cliente.println("STATUS=");  cliente.println(estado2);  cliente.print("<p>&nbsp;</p>");  


cliente.print("CLIMAS");
cliente.print("
");
cliente.println("<input type=submit value=ENCENDIDO style=width:150px;height:100px onClick=location.href='./?LED3=T\'><input type=submit value=APAGADO style=width:150px;height:100px onClick=location.href='./?LED3=F\'>"); 
cliente.println(" STATUS=");  cliente.println(estado3);  cliente.print("<p>&nbsp;</p>");  


cliente.print("CONTACTOS");
cliente.print("
");
cliente.println("<input type=submit value=ENCENDIDO style=width:150px;height:100px onClick=location.href='./?LED4=T\'><input type=submit value=APAGADO style=width:150px;height:100px onClick=location.href='./?LED4=F\'>"); 
cliente.println("STATUS=");  cliente.println(estado4);  cliente.print("<p>&nbsp;</p>");  

cliente.println("<h2>TEMPERATURA:</h2>");
cliente.print(t);
cliente.print("°C");
cliente.println("<h2>HUMEDAD RELATIVA:</h2>");
cliente.print(h);
cliente.print("%");

cliente.println("</body>"); 
cliente.println("</html>"); 
cliente.stop();

readString="";// termina control manual
 

   
}

}
}
}
}

eh intentado crear las funciones y llamarlas en el loop pero se ejecutan de igual manera auxilio !!!

Perhaps if you posted in English, when posting in the English language part of the forum...

Ahora esto es un doble post.
Ya te respondí en el otro.

Ahh y lee las normas del foro.
Si posteas en foro en inglés respeta el idioma base del foro.

  1. Este tipo de Microprocesador no es capaz de trabajar en paralelo.
  2. evita usar delay(). Esto bloquea la ejecución del programa porque el uC solo espera hasta que se acaba el periodo.
    Mira el ejemplo "blink without delay" para aprender lo básico
  3. Estudia otros ejemplos de "webserver", hay muchos, todo lo que quieres hacer de este tipo ya esta hecho por otro.