Score
0
Watch 12 Star 17 Fork 11

Mogoson / MGS-SerialPortC#MIT

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
Unity communicate with serialport. spread retract

Clone or download
Loading...
README.md

MGS-SerialPort

Summary

  • Unity communicate with serialport.

Demand

  • Serialport synchronous read and write data; parameters of serialport config in local file.

Environment

  • Unity 5.0 or above(If Unity 5.3 or higher version, the Json plugin(LitJson.dll) can be delete).

  • .Net Framework 2.0(Set the "Api Compatibility Level" as ".NET 2.0". Find in the path "Build Settings -> Player Settings -> Other Settings").

Background

  • Current Unity can not read serialport data in "Update" or "FixedUpdate" method.
  • Current Unity not implemented the "SerialPort.ReceivedBytesThreshold" property.
  • Current Unity can not callback the "SerialPort.DataReceived" event.
  • Current Unity can not read the "SerialPort.BytesToRead" property.
  • Current Unity can not execute the "SerialPort.DiscardInBuffer" method effectively.
  • Current Unity can not execute the "SerialPort.DiscardOutBuffer" method effectively.

Achieve

  • Config serialport parameters in local file.
  • Read config from local file and write config to file.
  • Read byte data from serialport and write byte data to serialport.

Demo

  • Demos in the path "MGS-SerialPort\Scenes" provide reference to you.

Preview

  • Serialport

Serialport

Contact

Comments ( 0 )

Sign in for post a comment

C#
1
https://gitee.com/Mogoson/mgs-serialport.git
git@gitee.com:Mogoson/mgs-serialport.git
Mogoson
mgs-serialport
MGS-SerialPort
master

Help Search