示例#1
0
    IEnumerator UpdateAngle()
    {
        if (IsConnected)
        {
            byte a = Convert.ToByte(canon.ConvertToArduinoAngles());

            byte[] array = { a };

            for (int i = 0; i < array.Length; i++)
            {
                print("Array [" + i + "] = " + array[i]);
            }

            SendMessage(array);
        }

        yield return(new WaitForSeconds(0.01f));

        StartCoroutine("UpdateAngle");
    }