2014-02-19 12:35 AM
Hi
I'm trying to write some values to a textfile but without success. I work with the IAR Workbench. Bellow the code which I found also in the Arm User Guide:#include <stdio.h>
FILE *f; f = fopen (''Test.txt'',''r''); /* Open a file from default drive. */ if (f == NULL) { printf (''File not found!\n''); }
The error is FILE and f undefined Can anybody help me what I'm doing wrong?Regards
2014-02-19 02:04 AM
Hi
''The error is FILE and f undefined Can anybody help me what I'm doing wrong?''
You are working in an embedded environment where there is no 'file' definition as standard. It is up to the developer to define/create the file definition. In other words - what/where is the file stream going to be directed? Where is the text file going to be stored (SD card, USB memory stick, NV RAM etc) What filing system is there?2014-02-19 03:51 AM
Hi
Ok thanks for your answer. I was wrong with my thinking:)regards2014-02-20 11:33 AM
''I was wrong with my thinking''
Yes - but all is not lost!There are plenty of examples of using file systems on microcontrollers; eg, with SD Cards.However, you might do well to start with some more basic, entry-level projects...