View Single Post
  #9   Spotlight this post!  
Unread 02-05-2013, 15:45
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Help for a beginner

Don't worry this is my first year doing java for my team and it worked out great. I can try to explain the API to you the best i can. It basically has everything that the wpi library has to help or tell you what features are there and how to use them. Like for jaguar. If you find the jaguar on there it says:
Constructor Summary
Jaguar(int channel)
Constructor that assumes the default digital module.
Jaguar(int slot, int channel)
Constructor that specifies the digital module.
So i dont need to specify a slot when im constructing this. So in my code it is
Jaguar jaguar1 = new "Jaguar(1)"; The quotations dont go in the code they are to show you what the API says to do to construct it.

void set(double speed)
Set the PWM value.

for this i can do if(joystick1.getRawButton(1)) {
jaguar1.set(0.64); //the jaguar values are -1 to 1 and 0 is no output
} else {
jagaur1.set(0.0);
}
I dont know if this helped you at all or not. Hopefully it did.
__________________
Reply With Quote