Motor temps on controller

I was playing around with the code a little bit, and can’t seem to find out how to display the motor temperatures on the controller. If anyone could help that would be great!

3 Likes

Print to controller:

https://api.vexcode.cloud/v5/html/classvex_1_1controller_1_1lcd.html#a309a67fd15913eaf46ed8f8d2607d939

Motor temperature:

https://api.vexcode.cloud/v5/html/classvex_1_1motor.html#a9cc3d4cd0d339f73c4824e6df0e601b1

Loop for updates

3 Likes

@Deicer image|231x500 is it the first print or 2nd print? And is it the first temp or the 2nd tempimage

both work. It appears the first displays the temperature as a percentage from maximum overheat while the second just gives you the temperature in whatever temp units you call. (Celsius or Fahrenheit judging from the docs on temp units)

2 Likes

Thank you. I will try this

I still couldn’t get it. It didn’t make sense. @jpearman or @Deicer , I would like some help. so far I have: Controller1.Screen.print(“Temp %f”, LeftSlurp.temperature(percentUnits::pct));

what were the issues with your program?

It image
It just has the zeros and doesn’t change

ah, you are printing the new values at the end of the previous print. I have my own problems with text positioning so I can’t give you a solution straight up, but you’ll need to clear the screen of your previous print before re-printing.

4 Likes

So if running the temperature code within the user control section of the competition template, is it enough to have it refresh through the while(true) loop of the joystick control functions?

yup. as long as it is being refreshed however often you need you can do it wherever you please.

1 Like