Having a hard time finding CTRE example Java code that is not for a drivetrain. We are looking to use closed-loop position or motion magic control with a feedforward and PID on a Talon SRX. We connect to an SRX Mag Encoder over a ribbon cable.
have you looked through CTRE’s examples on github?
this example looked similar to what you describe.
The ArmBotOffboard WPILib example project might also be useful here; just replace the stub
WPI_TalonSRX and so on.
Don’t know if it’s a good example, but at least one that worked is our 2019 codebase.
I think that Starlight’s recommendation of taking the current armbotoffboard example, and just replacing the CTRE specific stuff. If you combine that example with some of our example codebase you will probably be able to succeed relatively simply.