User Tools

Site Tools


info:wiznet_to_pachube_communications

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
info:wiznet_to_pachube_communications [2011/01/29 13:50] tomgeeinfo:wiznet_to_pachube_communications [2011/01/29 14:35] (current) tomgee
Line 25: Line 25:
  
  
-Using the Ethernet shield, that kind of a call is trivial. It’s just a series of print statements, like so:+Using the Arduino Ethernet shield, this kind of a call is trivial. It’s just a series of print statements
 + 
 +     // include the Ethernet library 
 +     #include <Ethernet.h> 
 +       
 +     // assign a MAC address for the ethernet controller. 
 +     // fill in your address here: 
 +     byte mac[] = { 
 +     0x000xAA, 0xAA, 0xAA, 0xAA, 0x01 }; 
 +     // assign an IP address for the controller: 
 +     byte ip[] = { 
 +       192,168,0,20 }; 
 +     // Assign the address of the server you want to connect to: 
 +     byte server[] = { 
 +       173,203,98,29 }; // pachube.com 
 +      
 +     // initialize the library instance: 
 +     Client client(server, 80); 
 +      
 +     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
info/wiznet_to_pachube_communications.1296327042.txt.gz · Last modified: 2011/01/29 13:50 by tomgee