V5 Brain Display

does anyone have code to show the motors internal temperature on the brain during a program???

What programming langauage are you using @braydencovey ?

Are you using V5 or 393s?

@abennett5139 We are using V5 motors with a 200 gear cartridge, we are using python

Here’s a quick program in Python to display the battery state and motor temp (for motor_15, one of my drive motors). It prints the motor temp, runs for 30 seconds, then prints the ending motor temp:

import vex
import sys

#region config
brain    = vex.Brain()
motor_15 = vex.Motor(vex.Ports.PORT15, vex.GearSetting.RATIO18_1, True)
motor_16 = vex.Motor(vex.Ports.PORT16, vex.GearSetting.RATIO18_1, False)
#endregion config

# main thread

brain.screen.print_line(2, 'Battery capacity plus motor temp')

brain.screen.print_line(3,brain.battery.capacity())
brain.screen.print_line(5,vex.Motor.temperature(motor_15))
motor_15.spin(vex.DirectionType.FWD)
sys.sleep(30)
brain.screen.print_line(6,vex.Motor.temperature(motor_15))
sys.sleep(5)

Could you use that for driver control???

Sure. I was trying to give you a quick demo of how to read the motor temp. This code adds the demonstration of how to display temps to the controller display.

import vex
import sys

#region config
brain    = vex.Brain()
motor_15 = vex.Motor(vex.Ports.PORT15, vex.GearSetting.RATIO18_1, True)
motor_16 = vex.Motor(vex.Ports.PORT16, vex.GearSetting.RATIO18_1, False)
#endregion config

# main thread

brain.screen.print_line(2, 'Battery capacity plus motor temp')

brain.screen.print_line(3,brain.battery.capacity())
brain.screen.print_line(5,vex.Motor.temperature(motor_15))
motor_15.spin(vex.DirectionType.FWD)
sys.sleep(10)
brain.screen.print_line(6,vex.Motor.temperature(motor_15))

#  Display motor temp on Controller display
con.screen.set_cursor(2, 1)
con.screen.print_((rightMotor.temperature(vex.PercentUnits.PCT)))

sys.sleep(5)
1 Like

any ideas for c++ code

First, please don’t revive threads that have been answered. If you have a question, yours being somewhat different than the one originally asked, create a new thread. Furthermore, your question has been asked and solved many times. Use the search feature in the top right to search for C++ versions of screen display. Searching exactly C++ might not get you what you desire, but searching in the vexcode api should also help.