VEXcode import doesn't work

Hi. I used to code on VCS but I learned that vcs is discontinued. I tried to import my code to VEXcode but It doesn’t work
#include"robot-config.cpp"
int main()
{
while(true)
{
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));

while(Controller1.ButtonUp.pressing())
{
axMotor.spin (rev,50,::rpm);
bxMotor.spin (rev,50,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
while(Controller1.ButtonDown.pressing())
{
axMotor.spin (fwd,50,::rpm);
bxMotor.spin (fwd,50,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
bxMotor.stop();
axMotor.stop();
while(Controller1.ButtonX.pressing())
{
cxMotor.spin (fwd,1000,::rpm);
dxMotor.spin (fwd,1000,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
while(Controller1.ButtonY.pressing())
{
cxMotor.spin (rev,1000,::rpm);
dxMotor.spin (rev,1000,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
cxMotor.stop();
dxMotor.stop();
while(Controller1.ButtonLeft.pressing())
{
xxMotor.spin (fwd,60,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
xxMotor.stop();
while(Controller1.ButtonRight.pressing())
{
xxMotor.spin (rev,60,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}

    xxMotor.stop();

while(Controller1.ButtonY.pressing())
{
cxMotor.spin (rev,30,::rpm);
dxMotor.spin (rev,30,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
cxMotor.stop();
dxMotor.stop();
while(Controller1.ButtonL1.pressing())
{
cxMotor.spin (rev,30,::rpm);
dxMotor.spin (rev,30,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
while(Controller1.ButtonL2.pressing())
{
cxMotor.spin (fwd,30,::rpm);
dxMotor.spin (fwd,30,::rpm);
LeftMotor.spin (fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2); //(Axis3+Axis4)/2);
RightMotor.spin (fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2);//(Axis3-Axis4)/2);
oxMotor.spin (fwd, (Controller1.Axis1.value()));
}
while(Controller1.ButtonR1.pressing())
{
cxMotor.spin (rev,30,::rpm);
dxMotor.spin (rev,30,::rpm);
xxMotor.spin (rev,60,::rpm);
}
while(Controller1.ButtonR2.pressing())
{
cxMotor.spin (fwd,30,::rpm);
dxMotor.spin (fwd,30,::rpm);
xxMotor.spin (fwd,60,::rpm);
}
}
}
It says that “No matching member function for call to ‘spin’”

“rev” is not a valid parameter for spin.

rev is a rotation unit.

use directionType::rev or reverse.

2 Likes

thank you but what about fwd. Fwd is red too

I see you used a while statement for the button pressing, but if you like doing more than one thing at a time use an if statement.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.