Storing MAC Address in EEPROM via Serial ASCII input.

mfriesen:
I didn't know this was possible. As the ip[] is retrieved from EEPROM I just assumed that the arduino would need an int rather than a stored ascii char. Would your method involve converting to an int after retrieving the value from EEPROM?

I don't know whether you have said what format you need the address in at runtime in order to use it. I have assumed you are using a binary representation of the address i.e. an IPv4 address is four bytes, Ethernet MAC address is six bytes, and so on. If your application needs to use them in some other form, that's fine too. Perhaps you need to provide a dotted decimal IPv4 address as an ASCII string.

I'm suggesting that whatever format you need it to be in to use it, should be the format you store it in. Take the received address in whatever format it is given to you, decode it as necessary to get it into the representation you need to use it. For example, if you're given a dotted decimal string and need a four-byte IPv4 address, you need to parse the string. Once you have the data in the format you want to use, just copy the bytes that hold that value in RAM to EEPROM - don't bother encoding or decoding at this stage. The only encoding/decoding needed is to convert from whatever format the address is being given to you, to whatever format you need to actually use the address.