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.
main.cpp@0:28e93e0b9f05, 2010-04-06 (annotated)
- Committer:
- chris
- Date:
- Tue Apr 06 14:09:54 2010 +0000
- Revision:
- 0:28e93e0b9f05
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chris | 0:28e93e0b9f05 | 1 | #include "mbed.h" |
| chris | 0:28e93e0b9f05 | 2 | #include "MSCFileSystem.h" |
| chris | 0:28e93e0b9f05 | 3 | |
| chris | 0:28e93e0b9f05 | 4 | AnalogIn ain (p20); |
| chris | 0:28e93e0b9f05 | 5 | DigitalOut myled(LED1); |
| chris | 0:28e93e0b9f05 | 6 | //LocalFileSystem fs ("fs"); |
| chris | 0:28e93e0b9f05 | 7 | MSCFileSystem fs("fs"); |
| chris | 0:28e93e0b9f05 | 8 | |
| chris | 0:28e93e0b9f05 | 9 | int main() { |
| chris | 0:28e93e0b9f05 | 10 | |
| chris | 0:28e93e0b9f05 | 11 | FILE *fp = fopen("/fs/data.csv","w"); |
| chris | 0:28e93e0b9f05 | 12 | |
| chris | 0:28e93e0b9f05 | 13 | for (int i = 0; i < 100 ; i++) { |
| chris | 0:28e93e0b9f05 | 14 | fprintf(fp,"%.2f\n",ain.read()); |
| chris | 0:28e93e0b9f05 | 15 | wait (0.1); |
| chris | 0:28e93e0b9f05 | 16 | } |
| chris | 0:28e93e0b9f05 | 17 | |
| chris | 0:28e93e0b9f05 | 18 | fclose(fp); |
| chris | 0:28e93e0b9f05 | 19 | myled=1; |
| chris | 0:28e93e0b9f05 | 20 | } |