// Update is called once per frame void Update() { if (Input.GetKeyDown("space")) { serialController.WriteToPort(messageToSend); //calls the WriteToPort function and sends a string to it. } }
/* * public IEnumerator createCoroutine(int messageIndex, float time) { * yield return new WaitForFixedTime (time); * serialController.WriteToPort(messages[messageIndex]); * Debug.Log ("Sent message " + messages [messageIndex]); * }*/ public IEnumerator createPausableCoroutine(int messageIndex, float time) { float timeCount = 0; while (timeCount < time) { if (!pause) { timeCount += Time.fixedDeltaTime; } yield return(null); } yield return(null); serialController.WriteToPort(messages[messageIndex]); Debug.Log("Sent message " + messages[messageIndex]); }
public void SendTestMessage() { serialController.WriteToPort(testMessage); }
// Use this for initialization void Start() { serialController.WriteToPort(messageOnStart); }