Datalogger example suggestion of modification... not working.

Hi,

I’ve my yun and I’ve been working with example sketches… In the case of Datalogger I found that it works slowly because is opening and clossing the file each loop. Even it’s reading the date from linux side in each cycle too.

I tried to modify defining the file in setup or in declarations at top of file but that doesn’t work for me. This is the example of code:

#include <FileIO.h>
File dataFile = FileSystem.open("/mnt/sda1/datalog3.txt", FILE_APPEND);
void setup() { ...
...
}

But it doesn’t works because when I execute I’ve the message: “Error opening datalog.txt”
What’s the problem? Why the scope is not ok? It is possible to open a file in linux side from arduino enviroment and mantain it open during the time the sketcht is running without having to open and close it? What am I doing wrong?

Hello,

Have some one the same problem?

I want to write data in a fastest way... One idea can be to store in arduino side and write more information each time but I prefer to do each time I get read from pins... Any ideas?