Printing Motor Velocity

Hi! We’re trying to figure out how fast each of our motors are moving so that we can fix a problem in our robot. We are trying to use code to figure this out, but instead of showing us the velocity that our motors are moving at, it just shows 0.
This is an example for one of the motors:

Brain.Screen.print(leftForward.velocity(vex::velocityUnits::pct));

Could someone give us another example of what we should write? Thank you!

Welcome to the VEXForum @comet!

Would this post help with what you are trying to do?

2 Likes

I tried this, but it is still showing me that the motor velocity is 0.00. :confused: Thank you though!

@comet Since you are using percent, try swapping %f with %d.

1 Like

Unfortunately that didn’t work either. It shows the velocity as 0 instead of 0.00 now.

Well, there could be various problems with the code. Here are some things that you should check:

Is the code in a while loop in driver control so that it constantly updates?

Is the brain screen being cleared so that the data isn’t overlapping?

If these suggestions don’t work, I would suggest that you post your code, which will enable the forum users (myself included) to help you debug. It’s hard to give many more suggestions without seeing it.

1 Like

This worked for me. It may be because you had too many arguments. It’s always best to keep your code clean.

  Brain.Screen.print(DriveRight.velocity(percent));