![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Oppgave9.1
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:7591d1dbca76
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 31 12:43:49 2017 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" + +DigitalOut Led1(LED1); +LocalFileSystem local("local"); +int main() +{ + int i=0, t=0; + + FILE *fp = fopen("/local/fil1.txt", "w"); + if (fp == NULL) { + Led1 = 1; + return 1; + } + + while (i < 100) { + for(t=0; t<10; t++) { + fprintf(fp,"%3d", i); + i++; + } + + fprintf(fp, "\n"); + + } + fclose(fp); + return 0; + + +} \ No newline at end of file