#include "WiFlyUDP.h" #include "TimerOne.h" #include uint16_t remote_Port = 8000; uint16_t local_Port = 9000; char ip_host[16] = ""; #define DEFAULT_ip_host "192.168.0.1" #define ssid "VDOSSIER" #define pass "VDOSSIER" boolean read_serial = false; byte VER = 0x02; char test_message[] = { // Message template commands '/', 'L', 'u', 'Z', // ANALOG OUT TEMPLATE B0 , B0 , B0, B0, ',', 'i', B0, B0, B0 , B0 , B0, B0 // 4 analog outs = 4 integers }; char incomming_message[] = { // Message template commands '/', 'L', 'u', 'Z', // ANALOG OUT TEMPLATE B0 , B0 , B0, B0, ',', 'i', B0, B0, B0 , B0 , B0, B0 // 4 analog outs = 4 integers }; byte incomming_count = 0; WiFlyUDP udp(&Serial); network_results networks; void timerIsr() { if(read_serial) { if(Serial.available()>0) { char inByte; inByte = Serial.read(); test_ip(inByte); test_incoming(inByte); } } } void software_Reset() // Restarts program from beginning but does not reset the peripherals and registers { asm volatile (" jmp 0"); } void ini() { Serial.begin(115200); if (EEPROM.read(0x30) == VER) { for(int i=0; i<16; i++) ip_host[i]='\x00'; //Limpia memoria for(int i=0; i<16; i++) ip_host[i] = EEPROM.read(i); } else { for(int i=0; i<16; i++) ip_host[i]='\x00'; //Limpia memoria for(int i=0; i<16; i++) EEPROM.write(i,'\x00'); //Limpia memoria for(int i=0; i0) // { // char inByte; // inByte = Serial.read(); // //Serial.write(inByte); // //Serial.println(inByte); // test_ip(inByte); // test_incoming(inByte); // } // } if (incomming_count==16) analogWrite(11, incomming_message[15]); //delay(100); //Serial.println("Conectado!!"); }