BabyWolf 87 Posted July 7, 2015 Boas, maltinha. Venho-vos aqui pedir ajuda numa questão pouco pertinente. Alguém tem conhecimento de programação em Arduino + Arduino Ethernet Shield? É o seguinte, tenho uma plataforma de gestão de telemóveis dentro de sala de aula e tenho a programação dos Infravermelhos e do led RGB a trabalhar correctamente. Só tenho o problema da ligação do website com o Arduino. Uma vez que faz parte da minha PAP, gostava de obter ajuda até hoje à noite. Já estive a pesquisar e tenho um Ethernet Shield funcional. Se alguém não se importar de me ajudar, por favor, mande MP aqui. Share this post Link to post Share on other sites
Possuido 0 Posted July 7, 2015 Por acaso estás a fazer isso com a net da escola? se sim não vais conseguir pois a escola tem muita coisa bloqueada. Share this post Link to post Share on other sites
morfo2 4,680 Posted July 7, 2015 Segue este tutorial e não te esqueças das portas: http://www.instructables.com/id/ServDuino-Arduino-Webserver/?ALLSTEPS 1 BabyWolf reacted to this Share this post Link to post Share on other sites
BabyWolf 87 Posted July 7, 2015 As bases foram renovadas, em princípio terei o website a correr do meu PC de casa c/ o No-IP. acham que é possível? Share this post Link to post Share on other sites
Possuido 0 Posted July 7, 2015 não precisas de nada disso, o arduino cria te o site tens é q configurar aquilo bem. Abre o arduino e vai a Exemplos > Ethernet > WebServer No arduino alteras o ip e o mac e depois mudas o site a teu gosto Share this post Link to post Share on other sites
BabyWolf 87 Posted July 7, 2015 não precisas de nada disso, o arduino cria te o site tens é q configurar aquilo bem. Abre o arduino e vai a Exemplos > Ethernet > WebServer No arduino alteras o ip e o mac e depois mudas o site a teu gosto Tens Skype ou e-mail? Share this post Link to post Share on other sites
BabyWolf 87 Posted July 8, 2015 #include <Ethernet.h> #include <SPI.h> byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xFC, 0x19 }; IPAddress ip(127, 0, 0, 1); EthernetClient client; int IRpin = A0; int IRemitter = 2; int ambientIR; int obstacleIR; int value[10]; int distance; int redPin = 4; int greenPin = 8; int bluePin = 6; void setup(){ Serial.begin(9600); /*if (Ethernet.begin(mac) == 0) { Serial.printIn("Falhou a configuração"); }*/ pinMode(IRemitter,OUTPUT); digitalWrite(IRemitter,LOW); pinMode(redPin,OUTPUT); pinMode(greenPin,OUTPUT); pinMode(bluePin,OUTPUT); } void loop(){ distance = readIR(5); /*Client.connect("http://127.0.0.1/"); Client.println(distance);*/ led(); } int readIR(int times){ for(int x=0;x<times;x++){ digitalWrite(IRemitter,LOW); ambientIR = analogRead(IRpin); digitalWrite(IRemitter,HIGH); delay(1); obstacleIR = analogRead(IRpin); value[x] = ambientIR-obstacleIR; } for(int x=0;x<times;x++){ distance+=value[x]; } return(distance/times); } void led(){ if(distance>1){ digitalWrite(redPin,HIGH); digitalWrite(greenPin,LOW); //client.connect("http://localhost/controlentry.php?type=clear",80); }else{ digitalWrite(redPin,LOW); digitalWrite(greenPin,HIGH); delay(150); //client.connect("http://localhost/controlentry.php?type=add",80); } } Update. Podem ajudar? Share this post Link to post Share on other sites