Fixed reading + adding test motor

This commit is contained in:
aarav18
2022-03-05 10:09:32 -07:00
parent 5db0596da7
commit a0ccfc3f66
7 changed files with 125 additions and 1 deletions
@@ -0,0 +1,23 @@
package frc4388.robot.subsystems;
import com.ctre.phoenix.sensors.CANCoder;
import com.revrobotics.CANSparkMax;
import com.revrobotics.RelativeEncoder;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc4388.utility.DesmosServer;
public class TestMotor extends SubsystemBase {
private CANSparkMax m_testMotor;
private RelativeEncoder m_testEncoder;
public TestMotor(CANSparkMax testMotor) {
m_testMotor = testMotor;
m_testEncoder = m_testMotor.getEncoder();
}
public void testDesmos() {
DesmosServer.putDecimal("Position", m_testEncoder.getPosition());
m_testMotor.set(DesmosServer.readDouble("Speed"));
}
}