This year my school just got the V5 system so I’m trying to make an encoder tick counter for a function to make it more accurate. I figured out how to make it reset the count and how to count it with the Motor.rotation command, however I want to display it on the screen as a double. How would I do this?
Look at the documentation, or research on this forum.
There is a way to print text to the screen in the API.
If you are stuck, come back telling us what you have tried and what does not work for you.
vex::motor Motor = vex::motor(vex::PORT1);
double ticks = Motor.rotation(vex::rotationUnits::(deg or rev);
this will keep on printing ticks so i recommend you insert something like “this_thread::yield;” but i do not know if this is available in VCS.
I also do not recommend VCS and i think you should switch to VEXcode or PROS. VEXcode it basically the same and in C++ aswell. PROS, on the other hand, you can do C++ and C and do a lot more complex things with PROS. If you are just starting to code I suggest you use VEXcode.
you need to read motor rotation inside the while loop for it to be updated.
Thanks man I just fixed it m. Enjoy