I'm able to echo the data from a 4-channel setup from vixen to a nano board. According to what I understand, vixen reads channel one, then channel two...until channel 4 is read. It will read zero or one depending on if a light is OFF or ON. Sequence.JPG. The image shows that channel one should be ON five times on that first green rectangle and the rest of the channels must be OFF. After sniffing the serial port, the data shows that the first channel is off, but the second channel is on instead. Sequence2.JPG. Can anyone tell me why the code jumps to the next byte? It behaves "most of the time" like this and sometimes it does it works as it suppose to work. Do I need to flush the serial port? Im using Arduino Uno to read off vixen. Could be that arduino UNO is not fast enough to update the serial port?. To clarify this post, please pay attention to the first green rectangle only. Thanks
Code:
...
case DISP://Decodes Data and Translates
state = IDLE;
for (ch = 0; ch < MAX_CHANNELS; ch++)
{
if (chVal[ch] > 0)
{
echoSerial.write((char)256- chVal[ch]);
}
else
{
echoSerial.write((char)chVal[ch]);
}
}
break;
}
}
}
Thanks
Bookmarks