コード例 #1
0
        void TestILI9163()
        {
            Console.WriteLine("Clear display");

            // Drawing natively in the display
            display.ClearScreen(250);

            Console.WriteLine("Refresh");

            display.Refresh();

            Console.WriteLine("Draw");

            for (int i = 0; i < 30; i++)
            {
                display.DrawPixel(i, i, true);
                display.DrawPixel(30 + i, i, true);
                display.DrawPixel(60 + i, i, true);
            }

            Console.WriteLine("Show");

            display.Show();

            Console.WriteLine("Show complete");

            // Drawing with Display Graphics Library
            graphics.CurrentFont = new Font8x8();
            graphics.Clear();
            graphics.DrawTriangle(10, 10, 50, 50, 10, 50, Meadow.Foundation.Color.Red);
            graphics.DrawRectangle(20, 15, 40, 20, Meadow.Foundation.Color.Yellow, false);
            graphics.DrawCircle(50, 50, 40, Meadow.Foundation.Color.Blue, false);
            graphics.DrawText(5, 5, "Meadow F7 SPI");
            graphics.Show();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: valoni/Netduino.Foundation
        public static void Main()
        {
            tft = new ILI9163(chipSelectPin: Pins.GPIO_PIN_D4,
                              dcPin: Pins.GPIO_PIN_D7,
                              resetPin: Pins.GPIO_PIN_D6,
                              width: 128,
                              height: 160,
                              spiModule: SPI.SPI_module.SPI1,
                              speedKHz: 15000);

            tft.ClearScreen(31);
            tft.Refresh();

            display = new GraphicsLibrary(tft);

            led             = new Led(Pins.ONBOARD_LED);
            button          = new PushButton(Pins.ONBOARD_BTN, CircuitTerminationType.CommonGround);
            button.Clicked += Button_Clicked;

            UITest();
            //DitherTest(tft);
            Thread.Sleep(-1);
        }