Example #1
0
        private static void ShutdownMotorsServos()
        {
            _servoController.PwmController.SetPwm(0, 0, 333);
            _servoController.PwmController.SetPwm(1, 0, 318);
            _servoController.PwmController.SetPwm(2, 0, 169);
            _servoController.PwmController.SetPwm(3, 0, 182);
            _servoController.PwmController.SetAllPwm(4096, 0);

            _motorController.GetMotor(1).Run(MotorAction.RELEASE);
            _motorController.GetMotor(2).Run(MotorAction.RELEASE);
            _motorController.GetMotor(3).Run(MotorAction.RELEASE);
            _motorController.GetMotor(4).Run(MotorAction.RELEASE);
        }
Example #2
0
        private async void GamepadRemoved(object sender, Gamepad gamepad)
        {
            _gamepad = null;

            while (!_isGamepadReadingStopped || !_isGamepadVibrationStopped)
            {
                await Task.Delay(10);
            }

            _motorController.GetMotor(1).Run(MotorAction.RELEASE);
            _motorController.GetMotor(2).Run(MotorAction.RELEASE);
            _motorController.GetMotor(3).Run(MotorAction.RELEASE);
            _motorController.GetMotor(4).Run(MotorAction.RELEASE);
        }