02-03-2012 01:45 PM
Kevin, Thanks. Thats exactly what I needed. The labview code below seems to work fine with the Serial.print(analogRead(x)) on my arduino. I have just two questions:
1. What does the "byte count" and "return count" in the VISA read routine tell me?
2. Thus far, Im getting just one analog channel and was just wondering what routine I can use to parse the data for two or more channels onto the chart? In the arduino code below there is a comma separating the two channels and a carriage return separating each read. I imagine theres a better way to do this as well. Like Serial.print(array) or something. Any suggestions are welcomed.
void setup()
{
Serial.begin(115200);
}
void loop()
{
Serial.print(int(Thermister(analogRead(0))));
Serial.print(",");
Serial.println(int(Thermister(analogRead(1))));
delay(50);
}
02-04-2012 06:26 PM
Hey,
Byte count is the number of bytes the read will wait for before returning (can also return because of a timeout). Return count is how many bytes are actually returned. There isn't a really great way to print back arrays from the Arduino other than doing it a byte at a time. Check out the Arduino serial documentation here:http://arduino.cc/en/Serial/Print its got some good information on the different data types it can take.
02-20-2012 02:41 PM
Kevin, Thanks. Ive got a single channel running well. Im wondering now how to parse data sent from more than one channel. Lets say I serial write out my data delimited with a comma. What VI do I need to add to parse that data and get it charted?