void setup() { Serial.begin(9600); Ethernet.begin(mac, ip); server.begin(); Serial.println("ready"); }
bool SetupWebServer ( void ) { bool success = false; #ifdef INTERFACE_ETHERNET #ifdef ETHERNET_WEBSERVER server.begin(); #endif //ETHERNET_WEBSERVER #endif // INTERFACE_ETHERNET return success; }
void NetworkConnectionClass::init() { // start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); Serial.print("IP Address: "); Serial.println(Ethernet.localIP()); sensorData = new LinkedList<SensorData*>(); state = RECV_DATA; }
void setup() { Serial.begin(9600); // Open serial communications and wait for port to open: pinMode(3, INPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); // start the Ethernet connection and the server: Ethernet.begin(mac); server.begin(); Serial.print("server is at "); Serial.println(Ethernet.localIP()); startRequest = false; }
void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } // start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); Serial.print("server is at "); Serial.println(Ethernet.localIP()); }
void setup() { Serial.begin(115200); pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(SPK, OUTPUT); Ethernet.begin(mac, ip, gateway, subnet); server.begin(); for(int i = 0; i < MAX_TASKS; i++) { taskList[i][0] = 0; } createTask(1, 0, 0); Serial.println("setup complete"); }
void setup() { Serial.begin(9600); uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05}; IPAddress myIP(192,168,0,6); Serial.println("Iniciando..."); Ethernet.begin(mac,myIP); server.begin(); Serial.println("Rodando!!!"); }
void setup() { // Open serial communications and wait for port to open: Serial.begin(115200); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only } // start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); Serial.print(F("server is at ")); Serial.println(Ethernet.localIP()); // setup Motors setupMotors(); }
void EthernetSup::begin(unsigned char *_mac, unsigned char *_ip) { IPAddress ip(_ip[0], _ip[1], _ip[2], _ip[3]); Ethernet.begin(_mac, ip); server.begin(); for (char i = 0; i < MAX_BUTTONS; i++) { buttonId[i] = -1; buttonType[i] = -1; buttonState[i] = 0; for (char j = 0; j < MAX_TEXT_BUTTON; j++) { buttonText[i][j] = 0; } dimmerStep[i] = -1; dimmerValue[i] = 0; dimmerDirection[i] = -1; } }
void setup() { // open the serial port Serial.begin(9600); // start the Ethernet connection: Serial.println("Trying to get an IP address using DHCP"); if (Ethernet.begin(mac) == 0) { Serial.println("Failed to configure Ethernet using DHCP"); // initialize the ethernet device not using DHCP: Ethernet.begin(mac, ip, gateway, subnet); } // print your local IP address: Serial.print("My IP address: "); ip = Ethernet.localIP(); for (byte thisByte = 0; thisByte < 4; thisByte++) { // print the value of each byte of the IP address: Serial.print(ip[thisByte], DEC); Serial.print("."); } Serial.println(); // start listening for clients server.begin(); }
void init_ethernet_logger(){ #ifdef DEBUG_ETHERNET_LOGGER DEBUG_1("Starting"); #endif byte mac[]={ETHERNET_MAC_ADDRESS}; #ifdef ETHERNET_IP_ADDRESS byte ip[]={ETHERNET_IP_ADDRESS}; byte dns[]={ETHERNET_DNS_ADDRESS}; byte gw[]={ETHERNET_GW_ADDRESS}; byte nm[]={ETHERNET_NETMASK}; Ethernet.begin(mac,ip,dns,gw,nm); #else // Use DHCP Ethernet.begin(mac); #endif #ifdef ETHERNET_ENABLE_SERVER eth_server.begin(); #endif #ifdef DEBUG_ETHERNET_LOGGER DEBUG_1("Finishing"); #endif }
void setup() { // start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); }
void setup(void) { status.reset(); /// Discrete & Analog IO pinMode(13, OUTPUT); // Arduino on-board LED pinMode(A0, OUTPUT); // Buzzer /// Comm. Channels // UART Serial.begin(115200); Serial.flush(); Serial.println("Starting up greenOmatic Duemilanove Testbed..."); Serial.print("Program compiled on "); Serial.print(__DATE__); Serial.print(" at "); Serial.println(__TIME__); Serial.println(); // RF #ifdef INTERFACE_ASK_RX pinMode(RF_RX_PIN, INPUT); vw_set_rx_pin(RF_RX_PIN); vw_setup(RF_BAUD); vw_rx_start (); Serial.print ("ASK RF Receiver configured on PIN "); Serial.print (RF_RX_PIN); Serial.print (" @ "); Serial.print (RF_BAUD, DEC); Serial.println(" baud."); #endif //INTERFACE_ASK_RX // Ethernet #ifdef INTERFACE_ETHERNET Serial.print("Starting Ethernet... "); #ifdef ETHERNET_DYNAMIC_IP int eth_stat = Ethernet.begin(mac); if (0 == eth_stat) { Serial.println(" Problem starting ethernet !"); status.ethernet_valid = status.ERROR; } else { Serial.print("Ethernet started, IP = "); Serial.println( Ethernet.localIP() ); status.ethernet_valid = status.VALID; } #else Ethernet.begin(mac, IPaddr); Serial.print("Ethernet started, IP = "); Serial.println( Ethernet.localIP() ); status.ethernet_valid = status.VALID; #endif //ETHERNET_DYNAMIC_IP #ifdef ETHERNET_WEBSERVER server.begin(); #endif //ETHERNET_WEBSERVER #ifdef ETHERNET_UDPCLIENT Udp.begin(localPort); #endif //ETHERNET_UDPCLIENT #endif /// Peripherals // I2C RTC #ifdef PERIPHERAL_RTCC Wire.begin(); rtc.begin(); if (rtc.isrunning()) { status.time_valid = status.VALID; GetDatetimeString(rtc.now()); Serial.print("RTCC configured on I2C. Time is currently "); Serial.println(currentTime); #ifdef ETHERNET_UDPCLIENT //TODO: Get NTP Time #else // Compare RTC time to this programs compile time DateTime rtcTime = rtc.now(); DateTime compileTime(F(__DATE__), F(__TIME__)); // If the compile-time is later (more recent) than the current RTC time, update the RTC if (compileTime.secondstime() > rtcTime.secondstime()) { Serial.println("Program compile-time is later than RTC time; updating RTC."); rtc.adjust( DateTime(F(__DATE__), F(__TIME__)) ); } #endif //ETHERNET_UDPCLIENT } else { status.time_valid = status.ERROR; // TODO, can we narrow this down further like with the DS1307RTC library? } #endif Serial.println("\nInitialization complete!\n\n"); }
void setup() { //debug Serial.begin(9600); //pin pinMode(resetPin, OUTPUT); pinMode(sdcPin, OUTPUT); //pinMode(ethPin, OUTPUT); pinMode(greLed, OUTPUT); pinMode(redLed, OUTPUT); // initialize SD card //digitalWrite(ethPin, LOW); //digitalWrite(sdcPin, HIGH); Serial.println("Initializing SD card..."); if (!SD.begin(sdcPin)) { Serial.println("ERROR - SD card initialization failed!"); return; } // check for file for (int i=0; i<HTTP_FILE; i++) { if (!SD.exists(GET[i])) { Serial.print("ERROR - Can't find "); Serial.println(GET[i]); return; // can't find index file } } if (!SD.exists(LOG)) { Serial.print("ERROR - Can't find "); Serial.println(LOG); return; // can't find index file } else { dataFile = SD.open(LOG, FILE_READ); if(dataFile) { char temp[3],c,d; while(dataFile.available()) { // X=123-Y=45- d = (char) dataFile.read(); // X or Y dataFile.read(); // = c = (char) dataFile.read(); for(int i=0;c!='-';i++) { temp[i] = c; c = (char) dataFile.read(); } String Coord(temp); if(d=='X') { Update('X',Coord.toInt()); } else if(d=='Y') { Update('Y',Coord.toInt()); } memset(temp, 0, sizeof temp); } dataFile.close(); } } Serial.println("SUCCESS - SD card initialized."); // initialize Ethernet device //digitalWrite(sdcPin, LOW); //digitalWrite(ethPin, HIGH); Ethernet.begin(mac, ip, gateway, subnet); server.begin(); Serial.println("SUCCESS - Ethernet initialized."); // servo Pin servoX.attach(xPin); servoY.attach(yPin); if(servoX.attached() && servoY.attached()) { Serial.println("SUCCESS - Servo initialized."); } else { Serial.println("ERROR - Servo initialization failed!"); return; } digitalWrite(redLed,LOW); digitalWrite(greLed,LOW); Serial.println("START"); }