Vai al contenuto

Furma94

Utente
  • Iscritto

  • Ultima visita

  1. Furma94 ha risposto a nicolini2000 nella messaggio in una discussione Arduino
    o sul sito ufficiale oppure consulta approfonditamente internet , perchè a livello di libri non ho mai sentito nessuno parlarne e ti confermo che una buona soluzione al tuo problema è arduino 1 + ethernet shield con SD+ modulo PPOE
  2. Furma94 ha risposto a raffica19 nella messaggio in una discussione Arduino
    In alternativa ti attacchi ad un relè a 5V e sei a posto e lavori con della 220w!
  3. Furma94 ha risposto a nicolini2000 nella messaggio in una discussione Arduino
    Ciao Sono nuovo nel forum ma ti posto un mio vecchio codice a 5 Led che facevano la "ola" con arduino 1 + ethernet shield Se rielabori il codice , togliendo quello in eccesso relativo alla ethernet shield , ti tornerà utile credo! A me per lo meno funzionava e ci ho messo una vita a scriverlo! /*Sketch a cura di Furma94 Esame di Stato 2013-2014 Inizio Progettazione 24/07/13 */ #include <String.h> //Libreria Stringhe (Variabile) #include <SPI.h> //Libreria effettiva utilizzo dei Pin LOW HIGH #include <Ethernet.h> //Libreria che inializza l'apertura della Shield applicata sull'Arduino byte mac_adress[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //Stringa Mac Adress byte indirizzo_ip[] = { 192, 168, 0, 8}; // indirizzo IP del server (Statico assegnato da qua) byte gateway[] = { 192, 168, 0, 1 }; // indirizzo ip del router byte subnet[] = { 255, 255, 255, 0 }; //subnet mask EthernetServer server(80); //server port int ledPin2 = 2; // Dichiarazione variabile led int ledPin3 = 3; // Dichiarazione variabile led int ledPin5 = 5; // Dichiarazione variabile led int ledPin6 = 6; // Dichiarazione variabile led int ledPin7 = 7; // Dichiarazione variabile led int ledPin8 = 8; // Dichiarazione variabile led int ledPin9 = 9; // Dichiarazione variabile led String readString; //string boolean LEDON = false; //LED Flag void setup(){ Ethernet.begin(mac_adress, indirizzo_ip, gateway, subnet); // Inializzazione shield con parametri di connessione in ordine 1)Mac 2)Ip 3)Gate 4)SubMask pinMode(ledPin2, OUTPUT); //Associazione In/Out al pin da associare pinMode(ledPin3, OUTPUT); pinMode(ledPin5, OUTPUT); pinMode(ledPin6, OUTPUT); pinMode(ledPin7, OUTPUT); pinMode(ledPin8, OUTPUT); pinMode(ledPin9, OUTPUT); Serial.begin(9600); } void loop(){ EthernetClient client = server.available(); if (client) { boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); readString.concat(c); //store characters to string //if HTTP request has ended if (c == '\n' && currentLineIsBlank) { Serial.print(readString); if(readString.indexOf("L=1") > 0) {//lets check if LED should be lighted //led has to be turned ON digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin6, HIGH); // set the LED on delay(250); digitalWrite(ledPin6, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin6, HIGH); // set the LED on delay(250); digitalWrite(ledPin6, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin6, HIGH); // set the LED on delay(250); digitalWrite(ledPin6, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin6, HIGH); // set the LED on delay(250); digitalWrite(ledPin6, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin6, HIGH); // set the LED on delay(250); digitalWrite(ledPin6, LOW); // set the LED on digitalWrite(ledPin5, HIGH); // set the LED on digitalWrite(ledPin7, HIGH); // set the LED on delay(250); digitalWrite(ledPin7, LOW); // set the LED on digitalWrite(ledPin5, LOW); // set the LED on digitalWrite(ledPin3, HIGH); // set the LED on digitalWrite(ledPin8, HIGH); // set the LED on delay(250); digitalWrite(ledPin3, LOW); // set the LED on digitalWrite(ledPin8, LOW); // set the LED on digitalWrite(ledPin2, HIGH); // set the LED on digitalWrite(ledPin9, HIGH); // set the LED on delay(250); digitalWrite(ledPin2, LOW); // set the LED on digitalWrite(ledPin9, LOW); // set the LED on LEDON = true; }else{ //led has to be turned OFF digitalWrite(ledPin2, LOW); // set the LED OFF digitalWrite(ledPin3, LOW); // set the LED OFF digitalWrite(ledPin5, LOW); // set the LED OFF digitalWrite(ledPin6, LOW); // set the LED OFF digitalWrite(ledPin7, LOW); // set the LED OFF digitalWrite(ledPin8, LOW); // set the LED OFF digitalWrite(ledPin9, LOW); // set the LED OFF LEDON = false; } // now output HTML data starting with standart header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(); client.print("<html><head><title>Tesi d'Esame a cura di Raffaele Formaggi e Spirandelli Alessio</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' ></head><body>"); //send first heading client.println("<h1>LED CONTROL by internet connection</h1>"); client.println("<hr />"); client.println("<h1>LED control</h1>"); //printing LED status client.print("<span>LED status: </span>"); if (LEDON) { client.println("<span style='color:green'>ON</span>"); } else { client.println("<span style='color:grey'>OFF</span>"); } client.print("<h2><a href='/?L=1'>ACCENDI</a> | <a href='/?L=0'>SPEGNI</a></h2>"); client.println("</body></html>"); readString=""; client.stop(); } //if c == /n } // if client available } // while client connesso } // if client } //loop
  4. Furma94 ha pubblicato un messaggio nella discussione in Presentati
    Salve a tutti sono un ragazzo che studia informatica ( e ne è appassionato ) spero di trovarmi bene sul forum e imparare e dare info riguardo -Arduino -Iphone -Acer -Ps3 e tutti i campi di mia competenza! Ciao a tutti!