Exemplo n.º 1
0
        private static void CircleMovementWithAbsolutePosition(ICommunication communication, bool debug)
        {
            var panTiltControl = new EneoPanTiltControl(communication, debug);

            panTiltControl.Start();
            panTiltControl.DisableLimit();

            //var random = new Random();

            for (var i = 0; i < 50; i++)
            {
                var positions = CalculatePolygon(i, new PointF(0, 0), 7);
                foreach (var position in positions)
                {
                    panTiltControl.MovePanAbsolute(position.X);
                    panTiltControl.MoveTiltAbsolute(position.Y);
                    Thread.Sleep(40);
                }

                //panTiltControl.PanTiltAbsolute(0, 0);
                //panTiltControl.ComparePosition(new PanTiltPosition(0, 0), 0.5, 20, 200);
            }

            panTiltControl.EnableLimit();
            panTiltControl.Dispose();
        }
Exemplo n.º 2
0
        private static void BasicMovementLogic(ICommunication communication)
        {
            while (true)
            {
                Console.WriteLine("Start");
                var panTiltControl = new EneoPanTiltControl(communication);
                panTiltControl.PositionChanged += PanTiltControl_OnPositionChanged;
                Console.WriteLine("Pan 80");
                panTiltControl.MovePanAbsolute(80);
                panTiltControl.MoveTiltAbsolute(0);
                Thread.Sleep(4000);
                Console.WriteLine("Pan 20");
                panTiltControl.MovePanAbsolute(20);
                panTiltControl.MoveTiltAbsolute(0);
                Thread.Sleep(4000);
                Console.WriteLine("Pan 80");
                panTiltControl.MovePanAbsolute(80);
                panTiltControl.MoveTiltAbsolute(0);
                Thread.Sleep(4000);
                Console.WriteLine("Pan 20");
                panTiltControl.MovePanAbsolute(20);
                panTiltControl.MoveTiltAbsolute(0);
                Thread.Sleep(4000);
                Console.WriteLine("Pan Relative 10");
                panTiltControl.PanRelative(10);
                Thread.Sleep(4000);
                Console.WriteLine("Stop Moving");
                panTiltControl.StopMoving();
                Thread.Sleep(1000);
                Console.WriteLine("Pan 20");
                panTiltControl.MovePanAbsolute(20);
                panTiltControl.MoveTiltAbsolute(0);
                Thread.Sleep(2000);

                panTiltControl.PositionChanged -= PanTiltControl_OnPositionChanged;
                panTiltControl.Dispose();
                Console.WriteLine("done");
                //Console.ReadLine();
            }
        }