View Single Post
  #13   Spotlight this post!  
Unread 15-02-2010, 02:53
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: Limit Switch Draws Tears

The digital input is one, or zero.
Don't count on the code handled by the final else
statement to ever get executed.

if (Dig1->Get() == 0)
{
jag1->Set(0.0);
jag2->Set(0.0);
jag3->Set(0.0);
jag4->Set(0.0);
}
else if(Dig1->Get() == 1)
{
jag1->Set(-leftstick->GetY());
jag2->Set(rightstick->GetY());
jag3->Set(-leftstick->GetY());
jag4->Set(rightstick->GetY());
}
else
{
jag1->Set(-1.0);
jag2->Set(1.0);
}