writing to a text file

hey.... can some 1 guide me..... i m reading rssi register of cc1101 using arduino... i want to save the data being read into a text file... any idea??

Where is the text file going to be held? on the PC or an SD card? If a PC then send it down the serial line and have the PC put it into a file. If on a SD card then write bytes to the card using the standard SD card examples.

on the pc.... could u help plxx.. i m new to arduino programming...

Just send the bytes you want in the text file to the Serial.print call. Then have a terminal emulator like putty running on the PC saving everything it receives into a file. It is a bit of a none question.

Have you been reading any of my replies? I did not post that code so why have you faked a quote from me. Very cross about people faking quotes.

hey sorry... tht was just a mistake.........

i was posting my code..

byte data[5]={12, 13, 1, 14, 15}; String datastring="RSSI"; File dataFile = open("trylog.txt", FILE_WRITE); void setup() { if (dataFile) { dataFile.println(datastring); dataFile.close(); Serial.println(datastring); } else {Serial.println("no");; } } void loop () { }

File dataFile = open("trylog.txt", FILE_WRITE);

You can not open a file on an arduino unless you have an SD card. You need to just send the bytes to the PC and have the PC create the file and store data it receives into it.

hmmm ... ok thankxxx 4 the help

Hi, I am not only new in arduino programming but also new in programming. I am trying to write data from the arduino and save it to a text file. All the techniques that are available are not helping in my situation since I am also using a MFC GUI to send commands to the arduino. I want to save the pulses from the encoder without the use of an SD card. Any help will be appreciated.

I want to save the pulses from the encoder without the use of an SD card.

So, where [u]do[/u] you expect to save them?

I want to save them in the PC

sphume: I want to save them in the PC

You need to send data to the serial port, then. But, not "pulses". That is a meaningless term. The encoder sets pins HIGH or LOW. You have some code that reads those states, and determines that the encoder has changed position, increasing or decreasing a value. You could send that data to the PC to be saved.

Then, you need an application on the PC that listens to the serial port, and deals with the data that comes in that port.

I actually want to stream encoder positions to a text file.

sphume: I actually want to stream encoder positions to a text file.

OK. Go for it.

Only if it is possible to do so.

sphume: Only if it is possible to do so.

I could do it, so it IS possible. Whether you could, or not, remains to be seen.

Please give me an idea on where to start.

Have you been reading the rest of this thread that you have hijacked?

In the Arduino You gather the data you want to send. Send it by using a serial print.

In some application you write in some language on your PC Read data from the serial port, write it to a file.

Grumpy_Mike: Have you been reading the rest of this thread that you have hijacked?

Yes I've read and attempted to do as it says in this thread, my problem is that once I send the data to the PC I cannot access the serial port from my GUI.

my problem is that once I send the data to the PC I cannot access the serial port from my GUI.

What is your GUI doing? If it is communicating with the Arduino, then IT should be what the Arduino is sending data to that needs to be saved to the file.