예제 #1
0
 public static void DrawCircleFractal(OLED _oledDisplay, int x, int y, int r)
 {
     _oledDisplay.DrawCircle(x, y, r, true);
     _oledDisplay.DrawCircle(x + r, y, r / 2, true);
     _oledDisplay.DrawCircle(x - r, y, r / 2, true);
     _oledDisplay.WriteDisplay();
 }
예제 #2
0
        public static void CircleDemo(OLED _oledDisplay)
        {
            Console.Clear();
            ConsoleEx.TitleBar(0, "Circle Demo");
            ConsoleEx.WriteMenu(0, 1, "Q)uit");
            var rnd = new Random();

            _oledDisplay.Clear(refresh: true);
            for (var i = 0; i < 16; i += 1)
            {
                var r = rnd.Next(2, 16);
                var x = rnd.Next(r + 1, _oledDisplay.Width - r);
                var y = rnd.Next(r + 1, _oledDisplay.Height - r);
                _oledDisplay.DrawCircle(x, y, r, true);
                _oledDisplay.WriteDisplay();

                Console.WriteLine("Circle {0:000},{1:000} r:{2:000}", x, y, r);
                TimePeriod.Sleep(125);
            }
        }