Do you think this would work?

Just wondering if you think it would work. ( This is in a competition template )

void usercontrol(void) {
// User control code here, inside the loop
while(true){
//Foward
leftmotor.spin(forward, Controller1.Axis3.value()+
rightmotor.spin(forward, Controller1.Axis2.value()+
//Backward
leftmotor.spin(reverse, Controller1.Axis3.value()-
rightmotor.spin(reverse, Controller1.Axis2.value()-
//Lift Up
leftlift.spin(forward, Controller1.ButtonL1.pressing()+
rightlift.spin(forward, Controller1.ButtonL1.pressing()+
//Lift Down
leftlift.spin(forward, Controller1.ButtonR1.pressing()-
rightlift.spin(forward, Controller1.ButtonR1.pressing()-

1 Like

No because you don’t close any of your motor spin commands’ parenthases

Also there arent any semicolons

3 Likes

Also need semicolons after most of the lines

2 Likes

How would i close the commands?

(I forget how to do the code tags but)
It should have a parenthesis and semicolon after it like this
leftmotor.spin(forward, Controller1.Axis3.value()+);
rightmotor.spin(forward, Controller1.Axis2.value()+);

2 Likes

when i try this, it comes up as an

{clang} Expected expression

Remove the + and - signs

1 Like

Example:
leftmotor.spin(forward, Controller1.Axis3.value());

I’m not sure if this is a necessity, but I also always add units like so:
leftmotor.spin(forward, Controller1.Axis3.value(), pct);

2 Likes

would this make it so the stick going toward the top makes the motor go forward and when the joystick goes down it will go in reverse?

I’m using your

leftmotor.spin(forward, Controller1.Axis3.value(), pct);

1 Like

Yes that is correct
(20 characters)

2 Likes