View Single Post
  #2   Spotlight this post!  
Unread 06-02-2008, 14:00
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: SET command duration?

SetXXX is a command instructing WPILIb to alter a default setting.

SetPWM(1,X) // Change PWM 1 from Default "127" to a X
SetGyroDeadBand(1 , X) // Change the Default Dead for Gyro 1 to X
SetUserDisplay ( X ) ; // Change the Default OI Display from 0 to X

Once a Set command is executed, it normally doesn't need to be resent unless
you need to modify the parameter. If X changes for any reason you need to recall
the set command.

Example:
// This will run a Victor connected to PWM 1 at full speed (255) forever
Autonomous ( ) {
SetPWM( 1, 255 ) ;
}

// This will run a Victor connected to PWM 1 at full speed (255) for 1 second (1000ms) then stop (127).
Autonomous ( ) {
SetPWM( 1, 255 );
Wait(1000);
SetPWM( 1, 127 );
}
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 06-02-2008 at 14:14.