Exemplo n.º 1
0
        public void stopDrive()
        {
            DriveOutput.Power      = 0;
            DriveOutput.TurnRatio  = 0;
            DriveOutput.TachoLimit = 0;

            BT.SendCommand(DriveOutput.ToCommand());
        }
Exemplo n.º 2
0
        /* Driving Control */
        public void startDrive(int speed, Direction d)
        {
            if (d == Direction.reverse)
            {
                speed = -speed;
            }
            DriveOutput.Power     = speed;
            DriveOutput.TurnRatio = speed;
            DriveOutput.RunState  = SetOutputState.RunStateType.Running;
            Console.WriteLine("Drive Speed: " + DriveOutput.getPower());

            BT.SendCommand(DriveOutput.ToCommand());
        }
Exemplo n.º 3
0
        public void speedAdjust(int newSpeed)
        {
            int power = DriveOutput.getPower();

            if (power != 0) // Don't drive motor if currently stopped
            {
                /* Exactly the same as 'start drive' */
                if (power < 0)
                {
                    newSpeed = -newSpeed;
                }

                DriveOutput.Power     = newSpeed;
                DriveOutput.TurnRatio = newSpeed;
                DriveOutput.RunState  = SetOutputState.RunStateType.Running;

                BT.SendCommand(DriveOutput.ToCommand());
            }
        }