Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   SET command duration? (http://www.chiefdelphi.com/forums/showthread.php?t=63381)

jonboy 06-02-2008 10:58

SET command duration?
 
I assume that the SETxxx(n,n) command when invoked in a function and the function returns, that SETxxx maintains the desired state/action after the return and during interrupts etc until the SETxxx is next invoked or a reset occurs. Correct?

Kingofl337 06-02-2008 14:00

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 );
}

jonboy 06-02-2008 14:39

Re: SET command duration?
 
Adam:

TNX for the prompt reply.


All times are GMT -5. The time now is 23:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi