I connected the Unity project to the Arduino board through the COM port. I get data from it when using SerialPort.ReadLine(), however, if I use SerialPort.ReadExisting(), I get an error:
Object reference not set to object instance
I need to use ReadExisting, as my application cannot keep up with the fact that the Ardunio board is spitting out data.
I have ReadExisting working perfectly in an XNA project, only when used in a unity project, I have problems.
Any help would be greatly appreciated.
source
share