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/DigitalInput.h>
|
||||
#include <frc/PWMVictorSPX.h>
|
||||
#include <frc/PWMSparkMax.h>
|
||||
#include <frc2/command/SubsystemBase.h>
|
||||
|
||||
/**
|
||||
@@ -50,6 +50,6 @@ class Claw : public frc2::SubsystemBase {
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{7};
|
||||
frc::PWMSparkMax m_motor{7};
|
||||
frc::DigitalInput m_contact{5};
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <frc/AnalogGyro.h>
|
||||
#include <frc/AnalogInput.h>
|
||||
#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>
|
||||
@@ -64,12 +64,12 @@ class DriveTrain : public frc2::SubsystemBase {
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_frontLeft{1};
|
||||
frc::PWMVictorSPX m_rearLeft{2};
|
||||
frc::PWMSparkMax m_frontLeft{1};
|
||||
frc::PWMSparkMax m_rearLeft{2};
|
||||
frc::SpeedControllerGroup m_left{m_frontLeft, m_rearLeft};
|
||||
|
||||
frc::PWMVictorSPX m_frontRight{3};
|
||||
frc::PWMVictorSPX m_rearRight{4};
|
||||
frc::PWMSparkMax m_frontRight{3};
|
||||
frc::PWMSparkMax m_rearRight{4};
|
||||
frc::SpeedControllerGroup m_right{m_frontRight, m_rearRight};
|
||||
|
||||
frc::DifferentialDrive m_robotDrive{m_left, m_right};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/AnalogPotentiometer.h>
|
||||
#include <frc/PWMVictorSPX.h>
|
||||
#include <frc/PWMSparkMax.h>
|
||||
#include <frc2/command/PIDSubsystem.h>
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ class Elevator : public frc2::PIDSubsystem {
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{5};
|
||||
frc::PWMSparkMax m_motor{5};
|
||||
double m_setpoint = 0;
|
||||
|
||||
// Conversion value of potentiometer varies between the real world and
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/AnalogPotentiometer.h>
|
||||
#include <frc/PWMVictorSPX.h>
|
||||
#include <frc/PWMSparkMax.h>
|
||||
#include <frc2/command/PIDSubsystem.h>
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ class Wrist : public frc2::PIDSubsystem {
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{6};
|
||||
frc::PWMSparkMax m_motor{6};
|
||||
double m_setpoint = 0;
|
||||
|
||||
// Conversion value of potentiometer varies between the real world and
|
||||
|
||||
Reference in New Issue
Block a user