Thread: Talon SR issues
View Single Post
  #7   Spotlight this post!  
Unread 01-02-2014, 15:25
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
Re: Talon SR issues

Quote:
Originally Posted by wildbot3844 View Post
Can you post what the code should look like to control a drive with talons?
By drive I assume you mean a robot drivetrain? That depends on what language you are using. Here's a quick example in Java:
Code:
import edu.wpi.first.wpilibj.*;

/**
 * Simple example of how to use Talons to control a drivetrain
 */
public class TalonExample extends IterativeRobot {
    private Joystick joystick = new Joystick(1);
    private Talon leftMotor = new Talon(1);
    private Talon rightMotor = new Talon(2);
    // Pass the RobotDrive constructor the two Talon objects we created
    private RobotDrive drive = new RobotDrive(leftMotor, rightMotor);

    public void teleopPeriodic() {
        drive.arcadeDrive(joystick.getY(), joystick.getX());
    }
}
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)

Reply With Quote