Пример #1
0
        public Windows10DriverPin(Windows10Driver driver, WinGpio.GpioPin pin)
        {
            _driver    = new WeakReference <Windows10Driver>(driver);
            _pin       = pin;
            _pinNumber = _pin.PinNumber;

            // Set a reasonable default for DebounceTimeout (until .NET Core API adds a DebouceTimeout property)
            _pin.DebounceTimeout = TimeSpan.FromMilliseconds(ReasonableDebounceTimeoutMillseconds);
        }
Пример #2
0
        /// <summary>
        /// Constructs a new instance of a <see cref="HummingBoardDriver"/>.
        /// This is currently only supported on Windows.
        /// </summary>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows</exception>
        public HummingBoardDriver()
        {
            if (Environment.OSVersion.Platform != PlatformID.Win32NT)
            {
                throw new PlatformNotSupportedException($"{GetType().Name} is only supported on Windows.");
            }

            _internalDriver = new Windows10Driver();
        }