read serial

Reading Arduino data directly into R

I have experimented with reading an Arduino signal into R in the past, using Rserve and Processing. Actually, it is much easier. I can read the output of my Arduino directly into R with the scan function. Here is my temperature sensor example again: And all it needs to read the signal into the R console with my computer is: > f <- file("/dev/cu.usbmodem3a21", open="r") > scan(f, n=1) <b>Read 1 item</b> [1] 20.

Connecting the real world to R with an Arduino

If connecting data to the real world is the next sexy job, then how do I do this? And how do I connect the real world to R? It can be done as Matt Shottwell showed with his home made ECG and a patched version of R at useR! 2011. However, there are other options as well and here I will use an Arduino. The Arduino is an open-source electronics prototyping platform.