Talon Motors

How do you declare talon motors in a program?
I looked around but couldn’t find any info on this.

You just declare them like as with victors and jaguars- They use the same PWM signal.

Jaguar *motora;
motora = new Jaguar(1);

Basically, you do not need to code any differently for Victors, Jaguars, or Talons.

In Java there is a Talon Class, there isn’t a similar one under C++?

The Java implementation has different max,min, and deadband values for each of the motor controller used for generating the PWM signal.

So while, interchanging them may work, it may not be completely correct, at least on the Java side.

Yes there is.

If you use the Jaguar class with a Talon (and don’t calibrate the Talon), you will end up with reduced range.

Ok, thanks for the info
All of the programmers on our team are completely new to FRC, so we are still learning a lot.

Actually, looking at the other people’s posts, and realizing there actually is a Talon class in C++ (How did I miss that…) you might want to use the Talon class. Basically just substitute “Talon” for “Jaguar” for declaration and initialization, and everything else is the same.

You can declare a Talon in C++ by writing
Talon t1 = new Talon(TALON_PORT);
when TALON_PORT is an int for the port.

Beaware that the RobotDrive class automatically initiallize jaguars when declaring the defult constructor (when the parameters are numbers).
So when you use Talons don’t decalre it like this:

RobotDrive drive = new RobotDrive(1, 2, 3, 4);

but like this
RobotDrive drive = new RobotDrive(new Talon(1), new Talon(2), new Talon(3), new Talon(4));

Doron

Also, is the min/max values for the talons the same as jaguars?
If not, what are the min/max values?

They’re the same. -1 to 1.

Ok, thanks :slight_smile:

*FWIW, under the hood they are not the same. Jag and Talon expect different min/max pulse widths.

That’s why WPILib provides separate drivers for them.
*
*

but on the programming side they are the same?

The purpose of the separate drivers is to present a common interface to the programmer.