Hello all,
I have been troubleshooting all night trying to figure out what I am doing wrong and have hit a roadblock. Hoping somebody can look at this code and serial output and tell me if this is something fixable or if my board is DOA.
To date I have tried:
Removing SD Card
Preventing Ethernet from grounding to USB
Setting Pin 4 to High
Power Cycling
Here is my test code:
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 50);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
int SDcard_SSpin= 4; // for Uno anyway
pinMode(SDcard_SSpin, OUTPUT);
digitalWrite(SDcard_SSpin, HIGH);
Ethernet.begin(mac, ip);
}
void loop()
{
Serial.println(Ethernet.localIP());
delay(1000);
}
HERE IS THE RESULT from serial:
140.79.175.131
190.27.0.4
147.139.222.219
255.0.0.0
0.0.7.0
3.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
I'm new to programming, but is this some sort of Memory leak or something?