View Single Post
  #2   Spotlight this post!  
Unread 14-01-2009, 18:53
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Wondering if anyone else is having an issue with Joysticks

Try this:
Code:
Joystick *left_stick, *right_stick;
left_stick  = Joystick::GetStickfromPort(1);
right_stick = Joystick::GetStickfromPort(2);
float SetValue = 0;

while(isOperatorControll()) {
	SetValue = 0;
	if(left_stick->GetTrigger()) SetValue = .5;
	if(right_stick->GetTrigger()) SetValue = -.5;
	left_steer.Set(SetValue);
	right_steer.Set(SetValue);
 }
I recall something about only being able to set speed controllers every (5 or 10, not sure exactly how many) milliseconds. I'm not sure if the Set method will prevent you from setting a motor speed too often, or if that is handled in the FPGA. If this is handled in the Set method, then this should work where the code you showed us didn't.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

Reply With Quote