コード例 #1
0
        public Display(DisplaySpiConnectionSettings settings, IGpioControllerFactory controllerFactory, ISPiDeviceFactory spiDeviceFactory)
        {
            _device = new Sh1106(settings.SpiConnectionSettings, settings.DcPin, settings.RstPin, spiDeviceFactory, controllerFactory);

            _image = new Bitmap(_width, _height, PixelFormat.Format16bppGrayScale);
            _disposables.Add(_image);
            _disposables.Add(_device);
        }
コード例 #2
0
 public Sh1106Display(DisplaySpiConnectionSettings settings, IGpioControllerFactory controllerFactory, ISPiDeviceFactory spiDeviceFactory) : base(Sh1106.Width, Sh1106.Height)
 {
     _device = new Sh1106(settings.SpiConnectionSettings, settings.DcPin, settings.RstPin, spiDeviceFactory, controllerFactory);
     _device.Init();
     Clear();
     _device.SetContrast(255);
     RegisterForDisposal(_device);
 }