private void Brake() { textBox1.Text += "Stop" + Environment.NewLine; if (motorPair != null) { motorPair.Brake(); } else { if (nxt.MotorB != null) { nxt.MotorB.Brake(); } if (nxt.MotorC != null) { nxt.MotorC.Brake(); } } nxtStatus[Motion.Forward] = false; nxtStatus[Motion.Back] = false; nxtStatus[Motion.TurnLeft] = false; nxtStatus[Motion.TurnRight] = false; nxtStatus[Motion.Brake] = true; }
static void Reverse() { motorPair.Brake(); // set to reverse brick.MotorA = new NxtMotor(true); brick.MotorC = new NxtMotor(true); motorPair = new NxtMotorSync(brick.MotorA, brick.MotorC); motorPair.Run(75, 0, 0); Thread.Sleep(1000); motorPair.Brake(); }
public void Brake() { m_motors.Brake(); }