Forum Discussion
Altera_Forum
Honored Contributor
13 years agoGp150, I did this to write a float value to the SD:
char *name = malloc(sizeof(char) * 10); // a string with 9 positions; 1 is for the '\0'
float valor = 3.14; //for example
sprintf(name, "%.2f", valor); //prints the float value to the string
int i = 0;
while(name != '\0')
{
alt_up_sd_card_write(handler, name);
i++;
}
Hope this helps you. Also, if you want to add a new line: alt_up_sd_card_write(handler, 13); alt_up_sd_card_write(handler, 10);