ok
i've had this working now using the following code:
pipeArduino = _pipeOpen( "cat /dev/ttyUSB0", "r" );
function fnArduinoRead()
{
s = _pipeRead( pipeArduino );
if (s != undefined && s != "")
{
sarr = s.split("\n");
status.text="";
for (i in sarr)
{
status.text += "[" + i + "]=" + sarr[i] + "\n";
if (Number(sarr[i])>0)
{
fInput = (Number(sarr[i])/1023.0 - 0.2)/0.4;
mcBG._alpha=100*fInput;
trace(fInput);
}
}
}
}
setInterval(this, "fnArduinoRead", 40);
there's a seperate as file with all the asnative links:
_pipeRead = ASnative(5,193);
_pipeOpen = ASnative(5,191);
_pipeClose = ASnative(5,195);
_PlayAudio = ASnative(5,151);
this worked fantasitcally (i had one variable coming in over from arduino as a decimal)
but after rebooting chumby
i'm not getting anything on /dev/ttyUSB0 anymore
when i run
i get no response
if arduino isn't plugged in then i get told that it doesn't exist
if i do
then i get loads of '@'s, constantly coming in
also, i notice that when cat is running, the lights on arduino spark up showing that transmission is happening
but nothing when cat is closed
any idea why i wouldn't get anything out of cat anymore?
when i connect arduino to my laptop i still get data coming out
i think maybe i need to set the baud rate etc on the chumby?