I am making my own activity watch with a user application for on the desktop. Now i want i got a bit of code that overflows (i think) my arduino. it runs the function 1 or 2 times and then it just stops working, it even removes itself from my com ports.
In the code below i try to convert a string to a float. can someone help me ?
This is total crap. The second argument is the size of the array you are trying to write to, NOT the number of characters in the String being operated on.
More crap. EEPROM.read() does NOT return a char. That it returns something the same SIZE is completely irrelevant.
Ditch the stupid String class all together. You KNOW how many characters need to be in the array. Just use a char array of the right size from the beginning.
The char array has to be at least one element bigger than the actual data you want to write into it.
If your number is going to be 9 characters long, you need char value[10].
And after your 9 characters, you need to put a char '/0', which is a byte with the number 0 in it 00000000 binary 0x00 hexadecimal, the 8-bit unsigned number 0.
And remember to put this into value[9] not into value[10] because the indexes of your ten element array run from 0 to 9 not to 10.