dimanche 12 février 2017

ARDUINO : Is email function and web server function able to run in parallel?

Is this 2 functions able to run at the same time? Because for current code, the web server able to run but email unable to send. If swap the arrangement of code of email and web server, then web server unable to run but email can.

void setup() {
Serial.begin(9600);
//****************************************[email]********************
// For debugging, wait until the serial console is connected
delay(4000);
while(!Serial);
Serial.print("DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("FAIL");
while(true);
}

Serial.println("OK");
delay(5000);

// Initialize condition pins
pinMode(inputPin, INPUT);
Serial.println("Setup complete.\n");
//****************************************[email]********************


//****************************************[Web Server]********************
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
//****************************************[Web Server]*********************

}

Aucun commentaire:

Enregistrer un commentaire