
code that works
using namespace vex;
// just for the example ......
vex::motor IntakeL(PORT1);
vex::motor IntakeR(PORT2);
vex::controller Controller;
void spinIntakes() {
IntakeL.spin(forward);
IntakeR.spin(forward);
}
void usercontrol() {
while(true) {
//user code here
// sleep a while
this_thread::sleep_for(20);
}
}
int main(){
// register callbacks once only...
Controller.ButtonL1.pressed( spinIntakes );
while(true){
// perhaps something can happen here
// sleep a while
this_thread::sleep_for(20);
}
}