Beispiel #1
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);
        }
Beispiel #2
0
        public static void WriteByte(this LedDriver driver, byte value)
        {
            for (int i = 0; i < 8; i++)
            {
                int bit = value & 0x80;
                value <<= 1;

                driver.WriteBit(bit != 0);
            }
        }
Beispiel #3
0
 public static void WriteBit(this LedDriver driver, bool value)
 {
     driver.WriteBit(value ? PinValue.High : PinValue.Low);
 }
Beispiel #4
0
 public DisplayDriver(LedDriver ledDriver)
 {
     ledDriver.ThrowIfNull(nameof(ledDriver));
     LedDriver = ledDriver;
 }