Preciso de ajuda o arduino esta resetando sozinho não sei se é no código mais se for e se alguém poder me ajudar o código é esse:

/*
HelloWorld.ino - Sample Code consuming Library for Ethernet ENC29J60 Module.
Prints Html page with one button for activating Arduino ports
Created by Renato Aloi, August, 2013.
Released into the public domain.
*/

#include <EtherEncLib.h>

int PinoLed1 = 9;
int PinoLed2 = 8;
int PinoLed3 = 7;
int PinoLed4 = 6;
int PinoLed5 = 5;

EtherEncLib lib(80);

static unsigned char ipaddr[] = { 192, 168, 0, 125 };
static unsigned char macaddr[] = { 0x54, 0x55, 0x58, 0x10, 0x00, 0x25 };

void setup()
{
Serial.begin(115200);

lib.begin(ipaddr, macaddr);

pinMode(PinoLed1, OUTPUT);
pinMode(PinoLed2, OUTPUT);
pinMode(PinoLed3, OUTPUT);
pinMode(PinoLed4, OUTPUT);
pinMode(PinoLed5, OUTPUT);
digitalWrite(PinoLed1, HIGH);
digitalWrite(PinoLed2, HIGH);
digitalWrite(PinoLed3, HIGH);
digitalWrite(PinoLed4, HIGH);
digitalWrite(PinoLed5, HIGH);

Serial.println("EtherEncLib.h started!");
}

void loop()
{

if (lib.available())
{

char *params = lib.getParams();

Serial.print("Params: ");
Serial.println(params);

lib.print("<HTML>");
lib.print("<HEAD><TITLE>Automacao Wellington</TITLE></HEAD>");
lib.print("<BODY>");

lib.print("<h3>Pronto para uso!</h3>");


// LED1 ACENDE
if (strcmp(params, "?led=cozinhaon") == 0){
digitalWrite(PinoLed1, LOW);

}
// LED2 ACENDE
else if(strcmp(params, "?led=areaon") == 0){
digitalWrite(PinoLed2, LOW);

}
// LED3 ACENDE
else if(strcmp(params, "?led=quartoon") == 0){
digitalWrite(PinoLed3, LOW);

}
// LED4 ACENDE
else if(strcmp(params, "?led=banheiroon") == 0){
digitalWrite(PinoLed4, LOW);

}
// LED5 ACENDE
else if(strcmp(params, "?led=vetiladoron") == 0){
digitalWrite(PinoLed5, LOW);

}
// APAGAR TODOS OS LEDS
else if(strcmp(params, "?led=todosoff") == 0){
digitalWrite(PinoLed1, HIGH);
delay(1000);
digitalWrite(PinoLed2, HIGH);
delay(1000);
digitalWrite(PinoLed3, HIGH);
delay(1000);
digitalWrite(PinoLed4, HIGH);
delay(1000);
digitalWrite(PinoLed5, HIGH);


}
// ACENDER TODOS OS LEDS
else if(strcmp(params, "?led=todoson") == 0){
digitalWrite(PinoLed1, LOW);
delay(1000);
digitalWrite(PinoLed2, LOW);
delay(1000);
digitalWrite(PinoLed3, LOW);
delay(1000);
digitalWrite(PinoLed4, LOW);
delay(1000);
digitalWrite(PinoLed5, LOW);



}
// APAGAR LED1
else if(strcmp(params, "?led=cozinhaoff") == 0){
digitalWrite(PinoLed1, HIGH);
}
// APAGAR LED2
else if(strcmp(params, "?led=areaoff") == 0){
digitalWrite(PinoLed2, HIGH);
}
// APAGAR LED3
else if(strcmp(params, "?led=quartooff") == 0){
digitalWrite(PinoLed3, HIGH);
}
// APAGAR LED4
else if(strcmp(params, "?led=banheirooff") == 0){
digitalWrite(PinoLed4, HIGH);
}
// APAGAR LED5
else if(strcmp(params, "?led=ventiladoroff") == 0){
digitalWrite(PinoLed5, HIGH);
}

lib.print("</BODY>");
lib.print("</HTML>");

lib.close();
}
}

Estou usando enc28j60 e aduino uno 

Exibições: 1207

Responder esta

Respostas a este tópico

me corrija se estiver errado mas estes módulos comprados normalmente acionam quando recebem 0v (GND).

tem um nome bonito isso, mas eu não lembro!!!!

é isso mesmo

RSS

© 2024   Criado por Marcelo Rodrigues.   Ativado por

Badges  |  Relatar um incidente  |  Termos de serviço