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.
10 years, 5 months ago.
retrieve data from local memory/SDcard
hello everyone
i have learned and tried to write data into local memory and save it in txt format. and i did it. next, i want to try retrieve the saved data and try to send in via xbee. is there any idea to retrieve data from mbed's local memory and send via xbee?
thank you
Question relating to:
1 Answer
10 years, 5 months ago.
Yes. Assuming you used a standard c FILE * to write the file then open the file as read only, exactly the same as you did to write it only "r" rather than "w". And then copy the file to the radio port.
serial radio(Tx,Rx); FILE *fp = fopen("myFile.txt","r"); if (fp) { while (!feof(fp)) { radio.putc(fgetc(fp)); } fclose(fp); }