public void stopDrive() { DriveOutput.Power = 0; DriveOutput.TurnRatio = 0; DriveOutput.TachoLimit = 0; BT.SendCommand(DriveOutput.ToCommand()); }
/* 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()); }
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()); } }