Controlling TalonSRX via the CAN bus

Since CANTalon for WPILib was removed, I imported the CTRE Phoenix libraries to be used in VSCode and enable CAN functionality for the TalonSRX. However, trying to import the needed libraries poses a challenge:

import com.ctre.CANTalon; is the CTRE documentation standard for accessing the TalonSRX. This can be seen here.

The import statement above cannot be resolved. I need to know how to control the TalonSRX via the CAN bus in order to employ all encoder functionality. Thank you guys!

The CANTalon shim was deprecated last year and removed entirely for this season.

You should start by reading CTRE’s documentation (all of it):

Use import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;

1 Like

nvm, you’re using c++ not java. Sorry!

The import statement in the OP is definitely Java, so I can see the confusion there.

This was the statement that fixed it, thank you so much!