Robot Mesh Coding Problem

I was trying to code my robot using encoders. There is no function to reset the encoder values or get the position of the motor.

If you know an alternative please help out to fix my problems.

Take a look at the api. It has all of your functions and their parameters and what each of them does.

2 Likes

To follow up on Cadaver_42’s reply, the class methods you are trying to use do not exist in Robot Mesh Studio or VEXcode. Please click the link in their reply to find the correct class methods.

2 Likes

Mine is for a Vex IQ robot

I am asking if there is any function for getting the position of the motor or resetting the encoder value

The IQ version of the motor class is almost the same as the V5 one: link. It has the same method names (resetRotation, setRotation, rotation) and signatures for the methods you’re interested in.

So how would i format this code so it doesnt give an error. Sorry i am new to this

void resetDriveEncoders() {
vex::motor::resetRotation(vex::motor driveRightFront):
vex::motor::resetRotation(driveRightBack):
vex::motor::resetRotation(driveLeftFront):
vex::motor::resetRotation(driveRightFront):
}

Unfortunately, the errors you’re making now are just “I don’t know C++ syntax” errors, and C++ syntax is a subject far too large for a forum post. (The highlighted error is just one of several that are visible in your screenshot.) You can get some of the basics by looking at other C++ programs. The V5 C++ projects in the featured projects tab would be a good place to start. Ultimately, though, C++ is not a language designed for beginners and will require you to sit down with a dedicated tutorial at some point to understand the more esoteric features of the language.

1 Like

are there any good tutorials you could recomend or is it possible for u to re write what i made