Check the following site: Converting Float to string and character array in a few simple steps - arduino - All. At the end, there is an Arduino code that converts a float value to a string value. It might be helpful for you.
You could also use the Datalogger example available under File>Examples>SD to check how a string value can be saved in a text file.
I don't use an Arduino (I forgot to mention this in my previous post).
I'm using the Intel Edison with the mini breakout board so I'm programming in C-code using the mraa libraries.
Do you have some example code working using that set up?
I want to save the file on the memory of the Edison so I don't use a SD card.
Thanks for your help.
Unfortunately, I don’t have a C example code for this. However, you could write your own code. Basically, you have to do two things:
- Convert from float to string: There are several ways to do this on the web. Actually, the one I posted above might work. You only have to understand how the algorithm works and implement it in C (or any other language). You could also look for other ways to implement this conversion in C, for example:
- Save a text file in memory: There are several examples for this on the web too. I recommend you to check the following sites, but you could also look for other examples as well: