Programming a 393 motor on v5

Hi,

We have not yet received our v5 motors and are trying to code 393’s on VCS C++ Pro. We are not quite sure how to get the motors to spin. This is our current code

int main(void) {
    while(true);
    motor_left.setVelocity(100,vex::percentUnits::pct);
   motor_left.spin(vex::directionType::fwd,50,vex::velocityUnits::rpm);
   
}

Is there something horribly wrong with this? Both our coder and I are new to C++ pro. Any Tips? Thanks in advance

-Evan

You don’t have anything in the while loop so it’s just looping doing nothing

this should work:


int main(void) {
    while(true){
        //motor_left.setVelocity(100,vex::percentUnits::pct); No need to set velocity to 100% if you're going to set it to 50rpm when you spin it
        motor_left.spin(vex::directionType::fwd,50,vex::velocityUnits::rpm);
    }
}

Here, I think this website can help you out a lot! Click me!

1 Like