So we are trying to program with TalonSRX this year. I Have tried programming with the examples in VSCode and various other examples but I have not been able to get the Talons and my robot to move. We have tried using the Y cable and each individual PWM cables.
On our old robot we were using VictorSp and VictorSPX. These both seem to work but can’t get the Talons to operate.
This is a demo program showing the use of the RobotDrive class, specifically
it contains the code necessary to operate a robot with tank drive.
*/
public class Robot extends TimedRobot {
private DifferentialDrive m_myRobot;
private Joystick m_leftStick;
private Joystick m_rightStick;
@Override
public void robotInit() {
m_myRobot = new DifferentialDrive(new PWMTalonSRX(0), new PWMTalonSRX(1));
m_leftStick = new Joystick(0);
m_rightStick = new Joystick(0);
}
@Override
public void teleopPeriodic() {
m_myRobot.tankDrive(m_leftStick.getY(), m_rightStick.getY());
}
}
I tried multiple different controller configurations. Only using one controller right now. Also tried the arcade drive example code with the same result.
Indication: Both LEDs quickly blink red then off. First one LED blinks red, followed immediately by the other, then finally both LEDs are off for a small period of time.
Problem:Limit Switch or Soft Limit Activated
Or together, or alternating, or strobing one direction or the other?
m_Left = new PWMTalonSRX(0);
m_Right = new PWMTalonSRX(1);
m_myRobot = new DifferentialDrive(m_Left, m_Right);
m_leftStick = new Joystick(0);
m_rightStick = new Joystick(1);
Make sure your DS has the Joysticks in the correct USB port.
I think the lights were blinking together but they could’ve been alternating I will have to check that tomorrow I have already left for the night from our lab.
Do the yellow wires on the SRXs connect to the PWM port 0 and 1 pins marked “S” on the RIO, and the green to the Ground symbol ⏚? If reversed or not connected there, this would cause the “no pwm” condition.
I was not there today but the robot got rewired with spark motor controllers and still did not have success. I don’t have the code that was changed but here are the pictures that was sent to me today. We used these sparks last year with no issues.