Friday February 18, 2011
Hello,
I would have announced the good news about my successful LabVIEW 2009 - Maple communication code sooner ( http://forums.leaflabs.com/topic.php?id=656 ), but a new Maple IDE bug almost caused me to give up two hours ago. The problem was not in the SerialUSB.println() function, but in SerialUSB.read().
The following code works on Maple IDE 0.0.9, but not with the latest Maple IDE snapshot ( described in http://forums.leaflabs.com/topic.php?id=651#post-3635 )
I cannot get the null character to display correctly, even using the backticks. I put a comment on the line where it should appear.
void setup()
{
}void loop()
{
int count=0;
char chararray[64];if (SerialUSB.available())
{
count=0;while (SerialUSB.available() > 0)
{
chararray[count++]=SerialUSB.read();
}chararray[count]='
\
'; /* null character to end the string */SerialUSB.println(chararray);
}
}
If you send "ABC" (without the quotes) using the serial monitor Maple IDE 0.0.9 correctly echos back "ABC", but the snapshot echos "AAA".
Is this an easy fix?
Thanks!
Stephen from NYC
P.S. - I am using Windows XP SP3 on a Pentium III laptop