File System program for mbed NXP LPC11U24 beta
Revision 0:996908fb20d9, committed 2011-10-20
- Comitter:
- chris
- Date:
- Thu Oct 20 11:28:24 2011 +0000
- Child:
- 1:64487aba68b6
- Commit message:
Changed in this revision
2011_10_19.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2011_10_19.lib Thu Oct 20 11:28:24 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/projects/mbed-libraries/svn/branches/emilmont/2011_10_19@161 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 20 11:28:24 2011 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" + +DigitalOut led1(LED1); +DigitalOut led2(LED2); + +AnalogIn ain(p20); + +LocalFileSystem fs("fs"); + +int main () { + + FILE *fp = fopen("/fs/data.csv","w"); + + for (int i=0; i < 100; i++) { + fprintf(fp,"%.2f\n",ain.read()); + wait(0.05); + led2 = !led2; + } + + fclose(fp); + led1=1; +}