Hi i am new to Arduino and I want to know if it is possible to read the data from a sensor that it is connected to the Arduino, I am using the Arduino mega 2560, which is already working, as I have a LED which change color depending on the detection of the object and then store it in a file as txt or another normal extension.
-
1You need to edit this question to be more specific about what you are asking. A typical Arduino can report data back to a USB host such as a PC (typically actually through a serial port like channel, although the transport is USB), however at least the ATmega-based ones are unable to act as hosts themselves, which means that they cannot directly write data to a USB device such as a flash drive.– Chris StrattonCommented Jul 3, 2017 at 12:48
-
That's correct. I use Arduinos of many flavors to write data out their serial port, and have a Python program on the PC side waiting for data on /dev/ttyUSB0 (for example). That works fine. Please take the tour at arduino.stackexchange.com/Tour then come back and edit this question to be more specifically about the Arduino. You are welcome here. But this question is in danger of being closed as-is.– SDsolarCommented Jul 4, 2017 at 2:44
2 Answers
I don't have experience with Processing, but probably that is what you need. It communicates through USB and with the CreateWriter function, you can create a text file.
More about Processing can be found at Processing
Also another thread at Electronics stack exchange might help:
Alternatives (also mentioned in the above thread):
- Use serial port directly with a terminal application on the PC
- Use an SD card inside the Arduino to log
-
Thanks I would want to do that with the serial port directly with a terminal application as putty or the Arduino serial monitor. Commented Jul 3, 2017 at 10:48
-
From what I understand from your question, you want to store the data displayed in the Serial monitor to a text file or something similar. As the Arduino itself cannot do this task, I used "GoBetwino" to save my data from an Arduino into a text file, from where you can export the data into Excel if you want charts and graphs. The process is fairly easy and described properly in their user manual. https://playground.arduino.cc/Interfacing/GoBetwino