Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FatFileSystem MSCFileSystem mbed
Fork of app-board-LocalFileSystem by
main.cpp@2:d2b00172588d, 2013-04-18 (annotated)
- Committer:
- chris
- Date:
- Thu Apr 18 13:42:16 2013 +0000
- Revision:
- 2:d2b00172588d
- Parent:
- 1:00053ea8a833
Example program showing logging to USB flash stick on the mbed apps board
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chris | 0:e762099aba67 | 1 | #include "mbed.h" |
| chris | 2:d2b00172588d | 2 | #include "MSCFileSystem.h" |
| chris | 0:e762099aba67 | 3 | |
| chris | 0:e762099aba67 | 4 | AnalogIn pot1(p19); |
| chris | 0:e762099aba67 | 5 | DigitalOut myled(LED1); |
| chris | 2:d2b00172588d | 6 | MSCFileSystem fs("fs"); |
| chris | 1:00053ea8a833 | 7 | |
| chris | 0:e762099aba67 | 8 | int main() |
| chris | 0:e762099aba67 | 9 | { |
| chris | 0:e762099aba67 | 10 | |
| chris | 1:00053ea8a833 | 11 | FILE *fp = fopen("/fs/data.csv","w"); |
| chris | 2:d2b00172588d | 12 | |
| chris | 0:e762099aba67 | 13 | for (int i=0; i < 100 ; i++) { |
| chris | 1:00053ea8a833 | 14 | fprintf(fp,"%.2f\n",pot1.read()); |
| chris | 0:e762099aba67 | 15 | wait(0.05); |
| chris | 0:e762099aba67 | 16 | myled = !myled; |
| chris | 0:e762099aba67 | 17 | } |
| chris | 2:d2b00172588d | 18 | |
| chris | 1:00053ea8a833 | 19 | fclose(fp); |
| chris | 0:e762099aba67 | 20 | myled = 1; |
| chris | 0:e762099aba67 | 21 | |
| chris | 0:e762099aba67 | 22 | } |
