Created
June 2, 2014 04:18
-
-
Save buritica/ad01f563407aa6c5fc28 to your computer and use it in GitHub Desktop.
Enable Galileo Ethernet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <SPI.h> | |
| #include <Ethernet.h> | |
| // the media access control (ethernet hardware) address for the Galileo: | |
| byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
| //the IP address for the Galileo: | |
| byte ip[] = { 192, 168, 1, 84 }; | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| Serial.println("Attempting to start Ethernet"); | |
| if (Ethernet.begin(mac) == 0) { | |
| Serial.println("Failed to configure Ethernet using DHCP"); | |
| Serial.println("Attempting to configure Ethernet using Static IP"); | |
| Ethernet.begin(mac, ip); | |
| } | |
| Serial.print("Your IP address: "); | |
| Serial.println(Ethernet.localIP()); | |
| } | |
| void loop () {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment