A couple of question about motor encoder program in Python:
How do I read the motor values (like speed) while driving/practice match? For instance, I wish to know the top speed of each of my motor when are is 2 of them powering 1 wheel.
How do I use encoder values as arguments in ‘if’ statements? For example, stop motor if it reaches 150RPM.
velocityUnits Defines the unit type of the velocity value returned.
Returns
Returns a double that represents the current velocity of the motor in the units defined in the parameter.
As for max speed, the usual way to do minima and maxima in programming is to keep track of the last minimum/maximum your code has seen, and compare the current value against it, updating the stored value as needed.
For using them inif statements, you just plop them in there like any other rvalue: