- Home /
Unity 4 can communicate with serial port?
I'm working on a script in c# for communicating with a micro-controller (8051) connected to the serial port and using
using System.IO.Ports;
and refreshing assets (Assets>Reimport All) isn't making Unity find this library. I keep getting errors like: [1]: /storage/temp/21979-errors.jpg I'm getting out of ideas...
For those who can't open the image showing the error: Assets/SerialPort.cs(19,20) error CS1061: Type SerialPort
does not contain a definition for Open
and no extension method Open
of type SerialPort
could be found (are you missing a using directive or assembly reference?)
Looking at your screenshot, your script is called SerialPort.cs and you appear to be trying to use an external class also called SerialPort. That's confusing the compiler.
Answer by Paulo Renaux · Feb 21, 2014 at 12:10 PM
Thank you Graham Dunnett, I'll try that.
[EDIT] Changed the script name and class name, now its working.
Can't believe I did such a stupid mistake, it cost me 2 weeks.
Your answer
Follow this Question
Related Questions
Serial port Read problem (DataReceivedHandler) 2 Answers
How can I make a serial connection in Javascript? 0 Answers
unity with 2 arduinos 0 Answers
Read in 2 Different Arduino Values 1 Answer
Serial Communication-Best Practise 1 Answer