View Single Post
  #8   Spotlight this post!  
Unread 14-02-2009, 19:06
Golto's Avatar
Golto Golto is offline
Registered User
AKA: Pat Plude
FRC #4572 (BArlow RobAutics)
Team Role: Mentor
 
Join Date: Oct 2006
Rookie Year: 2007
Location: Bethel, CT
Posts: 91
Golto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of light
Re: Programmer a motor with a trigger

try this (modify as needed)

Code:
while (IsOperatorControl)
if (LeftStick.GetRawButton(1) == true)
{
    roller.Set(1.0);
}
if (LeftStick.GetRawButton(1) == false)
{
    roller.Set(0.0);
}
Wait(0.005);
LeftStick is your left joystick variable
Roller is the function to be used with the trigger

No need for semaphores, and don't worry, the cRIO is so fast, you'd never notice the lag.

This is part of 558's codebase. If you need more help email me:

pplude@freehugalliance.com
__________________