Exemplo n.º 1
0
    private IEnumerator AnalogTest(Antilatency.HardwareExtensionInterface.IAnalogPin a1, Antilatency.HardwareExtensionInterface.IAnalogPin a2)
    {
        while (_aheiCotask != null)
        {
            yield return(new WaitForSeconds(0.001f));

            Debug.Log("Analog test");

            Debug.Log($"    Input 3 analog value: {a1.getValue()}");
            Debug.Log($"    Input 4 analog value: {a2.getValue()}");

            yield return(new WaitForSeconds(0.01f));
        }
    }
Exemplo n.º 2
0
    private IEnumerator TestBoardCoroutine(Antilatency.HardwareExtensionInterface.IInputPin inputPin, Antilatency.HardwareExtensionInterface.IOutputPin outputPin, Antilatency.HardwareExtensionInterface.IAnalogPin analogPin)
    {
        while (_aheiCotask != null)
        {
            yield return(new WaitForSeconds(0.001f));

            var inputValue = inputPin.getState();

            if (inputValue == Antilatency.HardwareExtensionInterface.Interop.PinState.Low)
            {
                outputPin.setState(Antilatency.HardwareExtensionInterface.Interop.PinState.High);
            }
            else
            {
                outputPin.setState(Antilatency.HardwareExtensionInterface.Interop.PinState.Low);
            }

            var analogValue = analogPin.getValue();
        }
    }