Displaying Motor/Controller values on Controller

Hi All - was wonder how we’d display the values (below) on the controller’s screen.

I tried all the toString() I could find/imagine and haven’t found the solution:


  Brain.Screen.print("CTLR: " + (Controller1.Axis1.value() + Controller1.Axis2.value())/2) + " RPM: " + Motor.velocity(velocityUnits:rpm));

Thanks

Controller.Screen.print
Controller.Screen.clearScreen
Controller.Screen.clearLine
Controller.Screen.newLine
Controller.Screen.setCursor

Use this:


Brain.Screen.print("CTLR: %d, RPM: %d", (Controller1.Axis1.value() + Controller1.Axis2.value())/2), Motor.velocity(velocityUnits:rpm));

also read this

1 Like

I’m not sure if this would work, but using a while loop and clearing the brain screen would give you constant feedback as to what the values are.
Here’s an example, but I haven’t tested it.

while(1){
    
    Brain.Screen.print("CTLR", ( (Controller1.Axis1.value() + Controller1.Axis2.value()) / 2) );
    Brain.Screen.print("RPM", Motor1.velocity(velocityUnits::rpm));
    task::sleep(25);
    Brain.Screen.clearScreen();
}
1 Like

@InsertString THANK YOU! This is exactly what I needed!

Would I be correct in ‘assuming’ we can use most C++ command / syntax with the VEXC++ API?

@jrobitai No problem, I’m glad to help! I would think most C++ commands work with VexC++. Don’t quote me though, I’m fairly new to programming.

This is great - the link as well! Thanks!

@jorbitai no problem!