Exemplo n.º 1
0
        public static void Main()
        {
            ST7735 display = new ST7735(
                NUCLEOF411.Gpio.D8,                //Reset
                NUCLEOF411.Gpio.D7,                //BackLight
                NUCLEOF411.Gpio.D9,                //A0 (DC) Control Pin / Data Command
                NUCLEOF411.SpiDevice.Sp2.Name,     //SPI SCK/MOSI
                NUCLEOF411.Gpio.D10                //chipSelect
                );

            display.TurnOn();

            short i = 0;

            display.DrawCircle(20, 20, 20, Color.Red);
            display.DrawRectangle(40, 40, 40, 40, Color.Cyan);
            display.DrawFilledRectangle(80, 80, 40, 40, Color.Blue);
            display.DrawText(10, 30, "Hello nanoFramework", Color.Green);
            display.DrawText(30, 60, "from ST7735 SPI", Color.Green);

            while (true)
            {
                i++;
                display.DrawText(10, 10, i.ToString(), Color.Green);

                Thread.Sleep(500);
            }
        }
Exemplo n.º 2
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.Landscape,
                Width       = 160,
                Height      = 128,
            };

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

            // Store for future using generic interface
            display = disp;

            // Add to device list
            devices.Add(display);

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

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

            // Start updates
            GraphicsPanel.AutoUpdate = true;
        }
Exemplo n.º 3
0
        public static void Main()
        {
            ST7735 display = new ST7735(
                STM32F411RE.Hardware.ArduinoPin.D8,                 //Reset
                STM32F411RE.Hardware.ArduinoPin.D7,                 //BackLight
                STM32F411RE.Hardware.ArduinoPin.D9,                 //A0 (DC) Control Pin / Data Command
                STM32F411RE.Hardware.SpiDevices.SPI2,               //SPI SCK/MOSI
                STM32F411RE.Hardware.ArduinoPin.D10                 //chipSelect
                );

            display.TurnOn();

            short i = 0;

            display.DrawCircle(20, 20, 20, Color.Red);
            display.DrawRectangle(40, 40, 40, 40, Color.Cyan);
            display.DrawFilledRectangle(80, 80, 40, 40, Color.Blue);
            display.DrawText(10, 30, "Hello .NET Microframework", Color.Green);
            display.DrawText(30, 60, "from ST7735 SPI", Color.Green);

            while (true)
            {
                i++;
                display.DrawText(10, 10, i.ToString(), Color.Green);

                Thread.Sleep(500);
            }
        }
Exemplo n.º 4
0
        public static void Main()
        {
            ST7735 DisplayShield = new ST7735(Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D10, SPI_Devices.SPI1);
            int    i             = 0;

            // Rectangle
            DisplayShield.DrawFilledRectangle(0, 0, 160, 128, Color.Black);
            Thread.Sleep(1000);

            DisplayShield.DrawLargeText(20, 30, ".NEMF v4.3", Color.Green);

            while (true)
            {
                DisplayShield.DrawText(30, 60, "Count: " + i++, Color.Magenta);
                Thread.Sleep(10);
            }
        }
Exemplo n.º 5
0
        public static void Main()
        {
            ST7735 DisplayShield = new ST7735(FEZPandaIII.Gpio.D8, FEZPandaIII.Gpio.D10, FEZPandaIII.SpiBus.Spi1);
            int    i             = 0;

            // Rectangle
            DisplayShield.DrawFilledRectangle(0, 0, 160, 128, Color.Black);
            Thread.Sleep(1000);

            DisplayShield.DrawLargeText(20, 30, ".NEMF v4.3", Color.Green);

            while (true)
            {
                DisplayShield.DrawText(30, 60, "Count: " + i++, Color.Magenta);
                Thread.Sleep(10);
            }
        }