You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#include "vex.h"
|
|
|
|
using namespace vex;
|
|
using signature = vision::signature;
|
|
using code = vision::code;
|
|
|
|
// A global instance of brain used for printing to the V5 Brain screen
|
|
brain Brain;
|
|
|
|
// VEXcode device constructors
|
|
|
|
// VEXcode generated functions
|
|
// define variables used for controlling motors based on controller inputs
|
|
|
|
// define a task that will handle monitoring inputs from Controller1
|
|
int rc_auto_loop_callback_Controller1() {
|
|
// process the controller input every 20 milliseconds
|
|
// update the motors based on the input values
|
|
while(true) {
|
|
// calculate the drivetrain motor velocities from the controller joystick axies
|
|
// left = Axis3
|
|
// right = Axis2
|
|
|
|
// wait before repeating the process
|
|
wait(20, msec);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* Used to initialize code/tasks/devices added using tools in VEXcode Text.
|
|
*
|
|
* This should be called at the start of your int main function.
|
|
*/
|
|
void vexcodeInit( void ) {
|
|
task rc_auto_loop_task_Controller1(rc_auto_loop_callback_Controller1);
|
|
} |