Write to textfile
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-19 12:35 AM
Posted on February 19, 2014 at 09:35
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
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-19 2:04 AM
Posted on February 19, 2014 at 11:04
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?Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-19 3:51 AM
Posted on February 19, 2014 at 12:51
Hi
Ok thanks for your answer. I was wrong with my thinking:)regardsOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-20 11:33 AM
Posted on February 20, 2014 at 20:33
''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...
A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
A complex system designed from scratch never works and cannot be patched up to make it work.
