Пример #1
0
        private static void TestMap()
        {
            BoardRenderer boardRenderer = new BoardRenderer();

            for (int tube = 0; tube < 7; tube++)
            {
                for (int digit = 0; digit < 12; digit++)
                {
                    Console.WriteLine($"Tube: {tube}, Digit: {digit}");
                    for (int i = 0; i < 100; i++)
                    {
                        var board = new Board();
                        board.Tubes[tube].Digits[digit].DutyCycle = i / 100.0;
                        boardRenderer.Render(board);
                        Thread.Sleep(1);
                    }
                    for (int i = 100; i > 0; i--)
                    {
                        var board = new Board();
                        board.Tubes[tube].Digits[digit].DutyCycle = i / 100.0;
                        boardRenderer.Render(board);
                        Thread.Sleep(1);
                    }
                    boardRenderer.Render(new Board());
                }
            }
            Console.WriteLine("Done");
        }
Пример #2
0
        static void Main(string[] args)
        {
            var buffer = new BufferBlock <UserInputEvent>();
            GpioInputHandler gpio2Listener = new GpioInputHandler(buffer);

            Task.Run(async() => await UserInputHandler(buffer));
            //TestMap();

            BoardRenderer renderer = new BoardRenderer();

            //renderer.Brightness = 0.1;
            renderer.Brightness = 0.3;
            boardState          = clock;
            while (true)
            {
                Board board = boardState.GetBoard();
                renderer.Render(board);
                Thread.Sleep(5);
            }
        }