public void ItCanSendTankCommands()
        {
            var comm       = new BluetoothCommunication("COM4");
            var controller = new BrickController(comm);

            Console.WriteLine("Connecting...");
            controller.Connect();

            controller.TankMove(50, 50, 2);
            controller.TankMove(50, -50, 2);
            controller.TankMove(-50, -50, 2);
        }
Example #2
0
        public async Task ItCanSendTankCommands()
        {
            var comm       = new MockCommunication();
            var controller = new BrickController(comm);

            Console.WriteLine("Connecting...");
            await controller.Connect();

            Console.WriteLine("Tank Move...");
            controller.TankMove(50, 50, 1);
            controller.TankMove(-50, -50, 1);
        }
Example #3
0
        static void Main()
        {
            var comm       = new BluetoothCommunication("COM4");
            var controller = new BrickController(comm);

            Task.Run(async() =>
            {
                await controller.Connect();

                for (var i = 0; i < 100; i++)
                {
                    while (controller.UltrasonicRange > 10)
                    {
                        Console.WriteLine(controller.UltrasonicRange);
                        controller.TankMove(50, 50, 0.5);
                    }

                    controller.TankMove(50, -50, 1);
                }
            });
        }