/// <summary> /// Moves the specified motors at a given speed for a certain amount of time. /// </summary> /// <param name="powerA">The power for Motor A.</param> /// <param name="powerB">The power for Motor B.</param> /// <param name="powerC">The power for Motor C.</param> /// <param name="milliseconds">The amount of milliseconds to wait.</param> /// <param name="coast">Determines whether to immediately stop the robot or to have it coast.</param> public void Move(sbyte powerA, sbyte powerB, sbyte powerC, int milliseconds, bool stop = true) { MotorA.On(powerA); MotorB.On(powerB); MotorC.On(powerC); Wait1MSec(milliseconds); if (stop) { StopAllMotors(); } }
/// <summary> /// Moves the specified motors for a certain amount of degrees. /// </summary> /// <param name="powerB">The power for Motor B</param> /// <param name="powerC">The power for Motor C</param> /// <param name="degrees">The amount of degrees to move</param> public void MoveByDegrees(sbyte powerA, sbyte powerB, sbyte powerC, uint degrees) { MotorA.On(powerA, degrees); MotorB.On(powerB, degrees); MotorC.On(powerC, degrees); Wait1MSec(100); do { } while (MotorB.IsRunning() && MotorC.IsRunning()); StopAllMotors(); }