info:wiznet_to_pachube_communications
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
info:wiznet_to_pachube_communications [2011/01/29 13:47] – tomgee | info:wiznet_to_pachube_communications [2011/01/29 14:35] (current) – tomgee | ||
---|---|---|---|
Line 22: | Line 22: | ||
126 | 126 | ||
+ | ==== The Code ==== | ||
+ | |||
+ | |||
+ | Using the Arduino Ethernet shield, this kind of a call is trivial. It’s just a series of print statements: | ||
+ | |||
+ | // include the Ethernet library | ||
+ | # | ||
+ | | ||
+ | // assign a MAC address for the ethernet controller. | ||
+ | // fill in your address here: | ||
+ | byte mac[] = { | ||
+ | 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x01 }; | ||
+ | // assign an IP address for the controller: | ||
+ | byte ip[] = { | ||
+ | | ||
+ | // Assign the address of the server you want to connect to: | ||
+ | byte server[] = { | ||
+ | | ||
+ | |||
+ | // initialize the library instance: | ||
+ | | ||
+ | |||
+ | long lastConnectionTime = 0; // last time you connected to the server, in milliseconds | ||
+ | |
info/wiznet_to_pachube_communications.1296326858.txt.gz · Last modified: 2011/01/29 13:47 by tomgee