示例#1
0
文件: Program.cs 项目: piers7/PiCandy
        private static void RunSelfTest(IPixelRenderer renderer)
        {
            Log.InfoFormat("Running self-test on {0}: {1} pixels", renderer, renderer.PixelCount);
            Log.InfoFormat("Red");
            for (int i = 0; i < renderer.PixelCount; i++)
            {
                renderer.SetPixels(n => n == i ? 0xff0000 : 0x000000);
                renderer.Show();
                Thread.Sleep(50);
            }

            Log.InfoFormat("Green");
            for (int i = 0; i < renderer.PixelCount; i++)
            {
                renderer.SetPixels(n => n == i ? 0x00ff00 : 0x000000);
                renderer.Show();
                Thread.Sleep(50);
            }

            Log.InfoFormat("Blue");
            for (int i = 0; i < renderer.PixelCount; i++)
            {
                renderer.SetPixels(n => n == i ? 0x0000ff : 0x000000);
                renderer.Show();
                Thread.Sleep(50);
            }
        }
示例#2
0
文件: Program.cs 项目: piers7/PiCandy
        private static void RunSelfTest(IPixelRenderer renderer)
        {
            Log.InfoFormat("Running self-test on {0}: {1} pixels", renderer, renderer.PixelCount);
            Log.InfoFormat("Red");
            for (int i = 0; i < renderer.PixelCount; i++)
            {
                renderer.SetPixels(n => n == i ? 0xff0000 : 0x000000);
                renderer.Show();
                Thread.Sleep(50);
            }

            Log.InfoFormat("Green");
            for (int i = 0; i < renderer.PixelCount; i++)
            {
                renderer.SetPixels(n => n == i ? 0x00ff00 : 0x000000);
                renderer.Show();
                Thread.Sleep(50);
            }

            Log.InfoFormat("Blue");
            for (int i = 0; i < renderer.PixelCount; i++)
            {
                renderer.SetPixels(n => n == i ? 0x0000ff : 0x000000);
                renderer.Show();
                Thread.Sleep(50);
            }
        }
示例#3
0
 public void Show()
 {
     _renderer.Show();
 }