Okay. So how do I fix the problem?
Okay. So how do I fix the problem?
There is nothing wrong with the code. The problem starts on the other end of the ethernet cable. You have not defined anything about that.
You have not said whether you are able to run the client example correctly. That would be a start.
Ethernet.begin(mac, subnet, gateway);
Wrong order of parameters, missing dns.
Did you read reply #13? It won't work until you call Ethernet.begin(mac) in the setup function.
edit: ...and called correctly.
TheSpy7:
Okay. So how do I fix the problem?
Uh, make it connect?
// start the serial library:
Serial.begin(9600);
// set display brightness
Serial.write(0x7C);
Serial.write(157);
// set screen size in case LCD gets derpy...
Serial.write(0xFE);
Serial.write(6);
Serial.write(0xFE);
Serial.write(4);
These Serial.writes will just produce garbage on the serial monitor. This is due to you having both the LCD and the monitor on Serial.
|þþþþþ?Phone number:þþ?Phone number:þþ
That accounts for the first group of garbage char's. The second and subsequent groups of garbage are coming from this
}
else
{
selectFirstLine();
Serial.print("Phone number:");
if (phoneNumber.length() > 0)
{
selectSecondLine();
Serial.print(phoneNumber);
}
I think, which means that phoneNumber has the crap in it. (or just maybe Serial.print() has a problem with String).
So and a debug statement to print out each key as you get it from the key pad i.e. in this bit of code
delay(70); // delay loop to keep the LCD from redrawing stuff too much
char keyPressed = keypad.getKey(); // need to check press selection on keypad
if (keyPressed)