Skip to content
Prev 349640 / 398513 Next

Windows serial connection

Using Windows 8.1

I have an Arduino connected and I am trying to read from and write to a
serial connection using R.  The problem involves the reading.  I am able to
establish the connection using the following:
I am able to write to the connection using:
I am able to read from the connection using:

b = readLines(a,n=1)

However, if I read the last line in the COM4 buffer, and the Arduino later
writes more to the buffer, I am unable to read it.  I only get
"character(0)".  The Arduino seems to be behaving okay, as I can read an
write using the Arduino Serial Monitor.  If after reaching this point, I
close the connection and open it again, I am able to read from COM4 again
(until I read a final value again).  Any ideas as to what might be going
one here?

Many thanks for any ideas.