コード例 #1
0
 public LedDriver(IGpioController controller, LedDriverSettings settings)
 {
     controller.ThrowIfNull(nameof(controller));
     settings.ThrowIfNull(nameof(settings));
     Controller = controller;
     Settings   = settings;
     SetUpController();
 }
コード例 #2
0
        public static LedDriver Create(LedDriverSettings settings)
        {
            settings.ThrowIfNull(nameof(settings));
            var controller = new GpioControllerWrapper(new GpioController(PinNumberingScheme.Logical));
            var driver     = new LedDriver(controller, settings);

            driver.ownsController = true;
            return(driver);
        }