I am having trouble getting my potentiometer code to do what I want it to. I simply want it to display the number of rotations that a single specific wheel does. I want it to display this information on the controllers screen. Any help will be greatly appreciated!
A potentiometer can’t even do 1 rotation. Encoders can do multiple rotations.
Oh, I knew that, I meant an encoder.
Alright, to refine my question. I am wondering how to display the v5 encoder rotations on the controllers screen. Sorry about my stupidity earlier. I am new to coding and vex in general. Thanks!
Are you able to figure out how to set up and read an encoder in your code? That would be the first step. If you don’t, try to read the API or find documentation. If you are stuck, come back here.
Next, find how to print something to the controller. Again, there is an API for this. It might be easier to print to the robot brain. The hardest part is probably converting the encoder value to text.
Maybe this will help Questions about LVGL & examples of V5 Displays
Ignore the lvgl stuff, just read how you can convert a number into text.
I will look at this in a bit, thank you so much!
Okay, so I got it working but I realized that the VCS API has a typo under the encoder sensing block. this is what it says,
Brain.Screen.printAt(1, 20, “Encoder value: %f degrees”, Encoder.rotation(roationUnits::deg));
it says roationUnits. that was my problem, when I added the t to make it rotationUnits, it compiled and downloaded fine. just thought that I would tell you all so that it can possibly get fixed by the creators of VCS.
VCS was supposed to be updated last October. Instead, there has been radio silence from them.
I would really suggest switching to VEXCode.
oh, alright I will try it. lol