Reading vars from Arduino

Hi there!

I’ve a problem with reading variables from arduino. I need an specific tasks that should be done inside Arduino (a digital sensor that needs nano-secs intervals) also other tasks that are using Firmata. I mixed my custom Arduino-specific tasks with the standard firmata sketch and the thing is running good.

The problem is that with my specific tasks, I’m getting a value stored on an Arduino variable and trying to pass this variable to OF without luck… My plan was to use Firmata-Arduino functions to write the var-value to a Analogic-Pin with writeAnalog, then on the OF side to read from that pin and get the var-value… but this is not running. I was trying to use serial.print from arduino and read the value with ofSerial but seems that is not possible to use firmata and serial prints at the same time…

I’m newbie in C++ language and with electronics so… any help will be very welcomed!

Thanks in advance.