Dataflash f;int x;f.scanf("%d\n", &x);f.rewind();f.printf(f, "Hello word\n");f.close();
FILE* f = open_dataflash();int x;fscanf(f, "%d\n", &x);rewind(f);fprintf(f, "Hello word\n");fclose(f);
The idea is to be able to use similar code wether you are writing to the uart, the EEPROM, a dataflash or an SD card.
2. Use the sdtio library (fopen, fprintf, etc.) The nice thing with this is that it's pretty standard for C users. It would be "the way to go" if Arduino had been designed for C users, but it's not -- and that's a good thing most of the time -- so it means that it's not very standard for Arduino users.Code example (I don't even know if we can do that, I'm not super familiar with the stdio library):Code: [Select]FILE* f = open_dataflash();int x;fscanf(f, "%d\n", &x);rewind(f);fprintf(f, "Hello word\n");fclose(f);Any ideas, suggestions, questions?
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16