Exemplo n.º 1
0
        /// <summary>
        /// Displays a flipping box with increasing speed
        /// </summary>
        private static void DisplayFlipBox()
        {
            // Create the auto bitmaps
            nano     = new ushort[400];
            black    = new ushort[400];
            nanoBlue = (ushort)ColorConversion.ToRgb565(Color888.NanoBlue);

            // Fill it with nanoFramework blue
            for (int i = 0; i < nano.Length; i++)
            {
                nano[i]  = nanoBlue;
                black[i] = 0;
            }

            // Do the flip
            for (int varDelay = 250; varDelay > 30; varDelay -= 20)
            {
                for (int i = 0; i < 2; i++)
                {
                    tft.Flush(120, 180, 20, 20, nano);
                    tft.Flush(140, 180, 20, 20, black);
                    tft.Flush(120, 200, 20, 20, black);
                    tft.Flush(140, 200, 20, 20, nano);
                    Thread.Sleep(varDelay);
                    tft.Flush(120, 180, 20, 20, black);
                    tft.Flush(140, 180, 20, 20, nano);
                    tft.Flush(120, 200, 20, 20, nano);
                    tft.Flush(140, 200, 20, 20, black);
                    Thread.Sleep(varDelay);
                }
            }
        }