Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 4 months ago.
Move to the right column
Hello to everyone. I have my little problems. I can not save data to the SD card. I want to record the left side to the right. not from top to bottom. My code
int b=15; int a=20;
int main() { mkdir("/sd/Sistem", 0777);
FILE *fp = fopen("/sd/Sistem/canbus.csv", "w"); if(fp == NULL) { error("Could not open file for write\n"); }
fprintf(fp, "%d%d \n",a,b); fprintf(fp, "aaaaaaaaaaaaaaaaaaa"); fclose(fp); }
I want to be like this
how can I do it? The sample code writers you please
1 Answer
8 years, 4 months ago.
You need to seperate your two values, now you print them right after each other. How to do this depends on your country/pc settings. For the US:
fprintf(fp, "%d,%d \n",a,b);
For (mainland?) Europe:
fprintf(fp, "%d;%d \n",a,b);