Only read if SerialPorts are open
This commit is contained in:
parent
3cb2990ef0
commit
f8098433c9
@ -50,8 +50,10 @@ public class Serial : MonoBehaviour
|
|||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
ReadHead(ComL, 0);
|
if(ComL.IsOpen)
|
||||||
ReadHead(ComR, 1);
|
ReadHead(ComL, 0);
|
||||||
|
if (ComR.IsOpen)
|
||||||
|
ReadHead(ComR, 1);
|
||||||
//SendTouch(ComL, TouchPackL);
|
//SendTouch(ComL, TouchPackL);
|
||||||
//SendTouch(ComR, TouchPackR);
|
//SendTouch(ComR, TouchPackR);
|
||||||
if (Input.GetKeyDown(KeyCode.M))
|
if (Input.GetKeyDown(KeyCode.M))
|
||||||
|
Loading…
Reference in New Issue
Block a user