Example #1
0
    private IEnumerator PulseCounterTest(Antilatency.HardwareExtensionInterface.IOutputPin output,
                                         Antilatency.HardwareExtensionInterface.IPulseCounterPin pulseCounter1,
                                         Antilatency.HardwareExtensionInterface.IPulseCounterPin pulseCounter2
                                         )
    {
        while (_aheiCotask != null)
        {
            yield return(new WaitForSeconds(0.001f));

            Debug.Log("Pulse counter test test");
            output.setState(Antilatency.HardwareExtensionInterface.Interop.PinState.Low);

            yield return(new WaitForSeconds(0.1f));

            output.setState(Antilatency.HardwareExtensionInterface.Interop.PinState.High);

            yield return(new WaitForSeconds(0.1f));

            Debug.Log($"    Pulse counter IO2 test:{pulseCounter1.getValue()}\n    Pulse counter IO8 test:{pulseCounter2.getValue()}");

            yield return(null);

            Debug.Log("-----");
        }
    }
Example #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();
        }
    }