Exemplo n.º 1
0
        public void Stop()
        {
            NxtBrick.MotorState state = new NxtBrick.MotorState();

            state.Power = 0;
            state.Mode = NxtBrick.MotorMode.None;
            state.RunState = NxtBrick.MotorRunState.Idle; // Motor will be idle
            State = state;

            Execute(State);
        }       
Exemplo n.º 2
0
        public void Start(int powerPercentage)
        {
            NxtBrick.MotorState state = new NxtBrick.MotorState();
            
            state.Power = powerPercentage;
            
            state.Regulation = RegulationMode; // Synced or idle
            // Turn on the motor
            state.Mode = NxtBrick.MotorMode.On | 
                ((RegulationMode == NxtBrick.MotorRegulationMode.Sync ||
                    RegulationMode == NxtBrick.MotorRegulationMode.Speed) ? NxtBrick.MotorMode.Regulated : 0);
            state.RunState = NxtBrick.MotorRunState.Running; // Motor will be running
            state.TachoLimit = 0; // Run forever
            State = state;

            Execute(State);
        }
Exemplo n.º 3
0
 public override bool SetMotorState(NxtBrick.Motor motor, NxtBrick.MotorState state)
 {
     throw new NotImplementedException();
 }