-1

How can I export the readings that are being sent to my Arduino Mega to a file?

I know there is a write() method but I can't find the documentation on how to use it.

I want the file to be created and stored on my PC not an SD card. Also I want to know if there is a way to do this without using external programs.

1
  • Where do you want this file to be? On an SD card or on your PC? Commented Jun 7, 2016 at 15:28

3 Answers 3

1

You can use a terminal program like putty or Minicom to write that data to a log file. Then you can use whatever program or app to process this log file. Both programs can read from the serial interface.

0

if your arduino is connected to a computer, you can create a small application that will listen to serial port and write on a file whatever arduino sends over the serial.

Alternatively you can write directly on an sdCard. (There are many sdCard shields available on the market.)

As for the write method, you probably are referring to write method of File class of SD library

2
  • Isn't there a way of doing this without having to use another program? Commented Jun 7, 2016 at 15:35
  • @IsabelAlphonse Use the serial terminal built into the Arduino IDE. And copy/paste the text from it into a text file ;) There isn't really a way to get stuff done on a PC, withouth a program ;D Commented Jun 7, 2016 at 15:37
0

I know there is a write() method but I can't find the documentation on how to use it.

You can use: Serial.write(F("TEXT")); to send text over the "serial communication". This basically means that your Arduino will send the text to your PC over the USB emulated COM port.

The magnifying glass button at the top-right of your Arduino IDE's screen will open the "Serial Monitor" here you can see the text that's coming from the Arduino, you can even send text back.

How can I export the readings that are being sent to my Arduino Mega to a file?

You could make your Arduino interface with an SD-card. Or use that serial connection I told you about.

You could create a program (on the PC) that takes the serial input and stores it into a file. A lot of examples from this should be on the internet. Another thing might be, to use a more advanced serial terminal. I believe "terminal.exe" allows "logging" to a file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.