I’m completely new to coding v5’s and coding in general, I saw the multitasking forum, but i tried using that code with actual motors and the controller, but I can’t get it to work.
plz dont bully me for crappy coding
my code currently
#include "robot-config.h"
int lift() {
while(1) {
if(Controller1.ButtonR1.pressing()){
Lift1.spin(vex::directionType::fwd, 100,vex::velocityUnits::pct);
Lift2.spin(vex::directionType::fwd, 100,vex::velocityUnits::pct);
vex::this_thread::sleep_for( 25 );
}
}
return(0);
}
int main(){
vex::thread t( lift );
while(true) {
if (Controller1.Axis3.value()){
DR1.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
DR2.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
}
if (Controller1.Axis2.value()) {
DL1.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
DL2.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
}
else{
DR1.stop(brakeType::brake);
DR2.stop(brakeType::brake);
DL1.stop(brakeType::brake);
DL2.stop(brakeType::brake);
Intake.stop(brakeType::brake);
Lift1.stop(brakeType::brake);
Lift2.stop(brakeType::brake);
}
}
vex::this_thread::sleep_for(10);
}