BrickPi.Movement.Motor.SetSpeed C# (CSharp) Method

SetSpeed() public method

Set the speed of the motor
public SetSpeed ( int speed ) : void
speed int speed is between -255 and +255
return void
        public void SetSpeed(int speed)
        {
            if (speed > 255)
                speed = 255;
            if (speed < -255)
                speed = -255;
            brick.BrickPi.Motor[(int)Port].Speed = speed;

            //raise the event to notify the UI
            OnPropertyChanged(nameof(Speed));
        }