Hi, for a program I'm writing, I am parsing one character at a time from an " ".read buffer i've set up and storing those as bytes. However where I'm getting stuck is that I need to combine say three or four bytes into one new byte. i looked at some of the references on the arduino page and found a little promise in the byte() command but I'm not sure how to setup the syntax for that. and i dont even know if its the right command.
basically what i am doing is that i am trying to read in an ip address, parse it, and store it as 4 bytes into the eeprom so that it can be read upon reboot. so what i have so far at accomplishing that is that i am reading a byte one at a time and storing it into 12 distinct bytes. so for example:
I notice that the indexes into the textBuff array are not contiguous. You could make a copy of the textBuff array from 10 through 25. Then change the value that was in 13, 17, 21, and 25 to NULL.
Then create a pointer to point to textCopy[0], and pass that pointer to atoi(). Save the returned integer. Increment the pointer by 4, and repeat, to get all 4 (byte sized) integers.
i really do appreciate your help on this but i read that last message over and over again trying to understand what you meant and i still dont fully understand. would you mind showing me a little sample code? especially on the atoi() command, i couldnt find too much online bout that command. what do you mean by pointer? and by copy the buffer do you mean like a memcopy? do you have sample code for that or a place where i can read up on it?
so i uploaded and tried your code and it worked flawlessly thank you. so then using your code i put it into my main code but everytime i try and compile it i get a "invalid conversion from 'char to 'char*'" error. heres the bit of code i entered to my main code: