Thread: CANJaguar
View Single Post
  #1   Spotlight this post!  
Unread 01-25-2012, 10:55 PM
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: CANJaguar

the info posted on the wrobotics site is called a JavaDoc, and it's a standard form of documentation that can be generated from JAva code automatically (as long as it'a commented properly). The JAvadocs for WPILib is distributed with the plugin package that you installed.

You can access these files locally on your machine by clicking the first logo in the bar at the top of NetBeans (Assuming that's what you're using), it should be the first link on the page that loads.

Check out some helpful guides on my teams site on:
Getting started with Java: Lecture 1, Lecture 2
JavaDocs: Intro/Setup, Use
CAN Jaguars

You're going to want to focus on the CANJaguar class.

Use is as simple as placing the following lines in the right places in your code.
Code:
import edu.wpi.first.wpilibj.CANJaguar;
CANJaguar leftMotor = new CanJaguar(12); //where 12 is the CAN ID assigned to the motor controller
leftMotor.set(x.x);    //where x.x is a value between -1.0 and 1.0 (or your joystick axis...)
Note the default mode of operation is %VBus, which is comparable to PWM, read up on our site and the NI docs to learn about the other modes of operation if that's your goal.
__________________
http://team2168.org
Reply With Quote