mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Use PWMSparkMax instead of PWMVictorSPX (#3156)
This accurately reflects the motor controllers that are distributed in the Kit of Parts.
This commit is contained in:
committed by
GitHub
parent
69e8d0b65d
commit
be0ce99007
@@ -5,7 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/Encoder.h>
|
||||
#include <frc/PWMVictorSPX.h>
|
||||
#include <frc/PWMSparkMax.h>
|
||||
#include <frc/SpeedControllerGroup.h>
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
@@ -70,10 +70,10 @@ class DriveSubsystem : public frc2::SubsystemBase {
|
||||
// declared private and exposed only through public methods.
|
||||
|
||||
// The motor controllers
|
||||
frc::PWMVictorSPX m_left1;
|
||||
frc::PWMVictorSPX m_left2;
|
||||
frc::PWMVictorSPX m_right1;
|
||||
frc::PWMVictorSPX m_right2;
|
||||
frc::PWMSparkMax m_left1;
|
||||
frc::PWMSparkMax m_left2;
|
||||
frc::PWMSparkMax m_right1;
|
||||
frc::PWMSparkMax m_right2;
|
||||
|
||||
// The motors on the left side of the drive
|
||||
frc::SpeedControllerGroup m_leftMotors{m_left1, m_left2};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/Encoder.h>
|
||||
#include <frc/PWMVictorSPX.h>
|
||||
#include <frc/PWMSparkMax.h>
|
||||
#include <frc/controller/SimpleMotorFeedforward.h>
|
||||
#include <frc2/command/PIDSubsystem.h>
|
||||
#include <units/angle.h>
|
||||
@@ -25,8 +25,8 @@ class ShooterSubsystem : public frc2::PIDSubsystem {
|
||||
void StopFeeder();
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_shooterMotor;
|
||||
frc::PWMVictorSPX m_feederMotor;
|
||||
frc::PWMSparkMax m_shooterMotor;
|
||||
frc::PWMSparkMax m_feederMotor;
|
||||
frc::Encoder m_shooterEncoder;
|
||||
frc::SimpleMotorFeedforward<units::turns> m_shooterFeedforward;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user