Well I am writing an Arduino sketch to read 4 sensors over I2C communication bus. What I want to do is to read for example my Temperature values and write them simultaneously in a (.txt) file on the PC....
Though I am not new to Arduino IDE but am still learning to program using the wire library... Can we achieve the task defined above using 'wire' library???
Or should I be using some other language to do this?
Please help me get started with this part of my program... Any pointers / Links / sample sketches / suggestions!!!
The wire library will allow you to use the I2C bus to read your sensors. You can then organize the data into packets and send the data to the PC via serial prints. I would write an application in Processing to send the data to a file, but you can also write the data to a terminal program that can save the data to a file. I can't recommend a terminal program, though, as I don't use any.
and write them simultaneously in a (.txt) file on the PC....
Not even remotely possible. The Arduino can NOT open a file on another computer. It can't write to the file.
The ONLY thing it can do is write to the serial port. You CAN write an application that runs on the PC, listens to the serial port, and writes to the file.
There are plenty of examples on the Playground, using a vast variety of languages, that show how to create such applications on the PC.
Just go get PuTTY or CoolTerm and have it read the COM port the Arduino is attached to. All you have to do to log is tell it to log to a file. Both are pretty easy to use and it beats having to spend months learning a new language just to log a serial port with text data ......
longjohn119:
Hasn't anyone ever heard of a serial terminal?
Just go get PuTTY or CoolTerm and have it read the COM port the Arduino is attached to. All you have to do to log is tell it to log to a file. Both are pretty easy to use and it beats having to spend months learning a new language just to log a serial port with text data ......
If all you want to do is log the data that is fine.
I suspect there are more ambitious plans for that data from the OP.