A driver for displays controlled by the ST7735 controller such as the Adafruit 1.8" color display.
This driver is adapted from several resources including Netduino Helpres and the Adafruit library for ST7735.
Inheritance: IGraphicsDisplay, IDevice, IDisposable
Esempio n. 1
0
        private async Task StartDisplayAsync()
        {
            // Create the display
            var disp = new ST7735()
            {
                ChipSelectLine = 0,
                ClockFrequency = 40000000, // Attempt to run at 40 MHz
                ControllerName = "SPI0",
                DataCommandPin = gpioController.OpenPin(12),
                DisplayType = ST7735DisplayType.RRed,
                ResetPin = gpioController.OpenPin(16),

                Orientation = DisplayOrientations.Portrait,
                Width = 128,
                Height = 160,
            };

            // Initialize the display
            await disp.InitializeAsync();

            // Update the display faster than the default of 1 second
            GraphicsPanel.UpdateInterval = 500;

            // Associate with display panel
            GraphicsPanel.Display = disp;

            // Start updates
            GraphicsPanel.AutoUpdate = true;
        }