how to make arduino read from a text file?

1,065 views
Skip to first unread message

Anay Joshi

unread,
Dec 25, 2010, 10:41:57 AM12/25/10
to Electronics Club IITB
hello all,
  i want to make arduino read some numbers from a text file periodically. (the text file would be updated periodically by a c program running on the computer)
how to do this?

regards

Sanket Diwale

unread,
Dec 25, 2010, 12:42:41 PM12/25/10
to elec...@googlegroups.com
you dont need to write to a text file
you can directly use serial port to send data from your c program to the uC
regards,
Sanket

Sanket Diwale

unread,
Dec 25, 2010, 12:43:55 PM12/25/10
to elec...@googlegroups.com
to do that there is a direct api using windows.h. u can create a serial port object, and then write to serial port likeu write to a file

Mehul Tikekar

unread,
Dec 25, 2010, 12:57:57 PM12/25/10
to elec...@googlegroups.com
An example using the windows.h API is at http://kartikmohta.com/wiki/Tech/SerialPort

The other method of writing data to file and having Hyperterminal read that file also works.

Mehul

Siraj Issani

unread,
Dec 26, 2010, 12:54:38 AM12/26/10
to elec...@googlegroups.com


On 25 Dec 2010 23:28, "Mehul Tikekar" <mehult...@gmail.com> wrote:
>
> An example using the windows.h API is at http://kartikmohta.com/wiki/Tech/SerialPort
>
> The other method of writing data to file and having Hyperterminal read that file also works.

Can hyperterminal read and send text files periodically?

Mehul Tikekar

unread,
Dec 26, 2010, 8:23:02 PM12/26/10
to elec...@googlegroups.com
On Sun, Dec 26, 2010 at 12:54 AM, Siraj Issani <siraj....@gmail.com> wrote:


On 25 Dec 2010 23:28, "Mehul Tikekar" <mehult...@gmail.com> wrote:
>
> An example using the windows.h API is at http://kartikmohta.com/wiki/Tech/SerialPort
>
> The other method of writing data to file and having Hyperterminal read that file also works.

Can hyperterminal read and send text files periodically?

Sorry, i had done it the other way round (uC sends data which gets written to a file which is read by C code)
I don't know if what Anay wants will work.

Chiraag Juvekar

unread,
Dec 27, 2010, 2:22:05 AM12/27/10
to elec...@googlegroups.com
AFAIK only the windows.h method works. There is a tutorial on stackoverflow or dreamincode.
Google.

Chiraag Juvekar,
www.ee.iitb.ac.in/student/~chiraag

"How happy is the blameless Vestal's lot! The world forgetting, by the world forgot.
Eternal sunshine of the spotless mind! Each pray'r accepted, and each wish resign'd."

Anay Joshi

unread,
Jan 4, 2011, 8:53:05 AM1/4/11
to elec...@googlegroups.com
thank you all,
yeah, writing directly on serial stream works, thanks !
on posix systems, there is a very good library for serial programming. it works like a charm :)
http://devlog.bigmonachus.org/2008/08/interfacing-arduino-with-c-and.html

regards


Reply all
Reply to author
Forward
0 new messages