diff options
Diffstat (limited to 'libraries/Ethernet/examples/PachubeClientString')
-rw-r--r-- | libraries/Ethernet/examples/PachubeClientString/PachubeClientString.ino (renamed from libraries/Ethernet/examples/PachubeClientString/PachubeClientString.pde) | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libraries/Ethernet/examples/PachubeClientString/PachubeClientString.pde b/libraries/Ethernet/examples/PachubeClientString/PachubeClientString.ino index e6dbf09..4a03100 100644 --- a/libraries/Ethernet/examples/PachubeClientString/PachubeClientString.pde +++ b/libraries/Ethernet/examples/PachubeClientString/PachubeClientString.ino @@ -14,7 +14,7 @@ * Ethernet shield attached to pins 10, 11, 12, 13 created 15 March 2010 - updated 4 Sep 2010 + updated 26 Oct 2011 by Tom Igoe This code is in the public domain. @@ -28,25 +28,28 @@ // fill in your address here: byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; +// fill in an available IP address on your network here, +// for manual configuration: +IPAddress ip(10,0,1,20); // initialize the library instance: -Client client; +EthernetClient client; long lastConnectionTime = 0; // last time you connected to the server, in milliseconds boolean lastConnected = false; // state of the connection last time through the main loop const int postingInterval = 10000; //delay between updates to Pachube.com void setup() { - // start the ethernet connection and serial port: + // start serial port: Serial.begin(9600); + // give the ethernet module time to boot up: + delay(1000); + // start the Ethernet connection: if (Ethernet.begin(mac) == 0) { Serial.println("Failed to configure Ethernet using DHCP"); - // no point in carrying on, so do nothing forevermore: - for(;;) - ; + // Configure manually: + Ethernet.begin(mac, ip); } - // give the ethernet module time to boot up: - delay(1000); } void loop() { |