示例#1
0
    private IEnumerator TestButton(Antilatency.HardwareExtensionInterface.IInputPin inputPin)
    {
        while (_aheiCotask != null)
        {
            yield return(new WaitForSeconds(0.001f));

            var inputValue = inputPin.getState();

            if (inputValue == Antilatency.HardwareExtensionInterface.Interop.PinState.Low)
            {
                OnButtonReleased.Invoke();
                if (_playing == true)
                {
                    OnButtonReleased.Invoke();
                    _playing = false;
                }
            }
            else
            {
                if (_playing == false)
                {
                    OnButtonPressed.Invoke();
                    _playing = true;
                }
            }
        }
    }
示例#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();
        }
    }