Serial monitor's output to text file

Hi guys, this is my first post in here and not sure if I am in the right forum section. Sorry, if it is not!

Just a simple question: is there a way to print out the Serial monitor's output into a txt file?

I've tried typing "tail -f /dev/ttyACM0 > output.txt" command into the terminal but this gave me the following error:

"Unable to open "/ dev / ttyACM0" for reading: device or resource busy"

Thanks in advance to anyone would give me any feedback!! Filippo

I don't think so. Just use another terminal program such as PuTTY or Minicom.

...R

Thank you so much Robin for the quick reply!
And what about writing values into a .csv file, using fopen function? Is this way more feasible than the one I’ve asked for before?

Filippo

filippodamuzzo: And what about writing values into a .csv file, using fopen function? Is this way more feasible than the one I've asked for before?

What "one" did you ask before? When and where?

Where is the fopen function? That sounds like it is in a programming language. If so do you mean a programming language on the PC or on the Arduino? Most PC programming languages can communicate with an Arduino. This Python - Arduino demo may be of interest.

...R

Sorry if I did not explain well. The "one before" was the "tail -f /dev/ttyACM0 > output.txt" command mentioned in my first answer in this thread.

The fopen function is in the Arduino code, of course. I am using a wearable board (Adafruit Flora, that's Arduino compatible) and I was thinking to use this function into the loop function in order to write the values I will send out to the serial monitor in a csv file.

Is my idea feasible?

Thanks, Filippo

filippodamuzzo: The fopen function is in the Arduino code, of course.

You might consider posting the code so we can see what you are referring to?

I am using a wearable board (Adafruit Flora, that's Arduino compatible) and I was thinking to use this function into the loop function in order to write the values I will send out to the serial monitor in a csv file.

Serial.print() is what you use to send data over a serial connection. I don't know what you have in mind for fopen()

...R

If you don't want to use python but have access to office Excel you could use PLX-DAQ-V2 which has file functions.

Is very simple to integrate with a sketch and has quite a few other bells and whistles too.

@Robin2 Actually I do not write the code part related to my question. I am just looking for its feasibility. Basically, my idea is to save the same output I write out to the serial monitor using Serial.print() function into a csv file on my PC (e.g. into the same folder the .ino file).

Anyway, thanks for the help and replies. I'll try writing some code and then I eventually post it in caso of troubles.

Thanks again, also to @ballscrewbob for the precius link!

Filippo