Autonomous programs in driver controlled period

Hey All,
Im wondering if it is possible to program an autonomous function (such as an algorithmic lowering of arm, actuation of a claw, raising of arm) and set that to a single button, which can then be pressed during driver control period. If this is something you have done before or are familiar with, please let me know how you would go about setting this up in easyc.

In addition(which kind of goes along with this post) -this may be a ridiculous question, but I’m still new to programming- Are sensors (IME, potentiometers, ultrasonic rangefinders…) only for allowing a programmer to create precise movement during autonomous controlled portions of a match, or can you utilize them during driver control periods to allow for more precise movements? If so, can anyone point me to a link (or help directly) that may help me better understand how I would go about doing this.

Thank you so much for you time and thoughtful responses they are much appreciated,

Cyber Vipers
Granada Hills, CA

You can do these things. You just use a button to run a function.

If (GetJoystickDigital() == 1) {
AutoDrive(); //call autodrive function
}

If you want to have control over other things while also executing the pre-programmed functions you can take a look at the sample PID code with Interrupt Service Routine in the samples. You just need to remember the drivetrain / other device code needs to keep running while your other code is executing. Also, make sure joystick code and autonomous codes are not trying to both control a motor at the same time.