Motor Sensing#
To make Motor blocks appear in VEXcode V5, a Motor or Motor Group must be configured in the Devices window.
Refer to these articles for configuration information:
For information about how Motors and Motor Groups work, go to these articles:
Motor is Done?#
The Motor is Done? block is used to report if the selected V5 Smart Motor or Motor Group has completed its movement.
<[ClawMotor v] is done?>
The Motor is Done? block reports True
when the selected Motor or Motor Group has completed its movement.
The Motor is Done? block reports False
when the selected Motor or Motor Group is still moving.
Choose which Motor or Motor Group to use.
Motor is Spinning?#
The Motor is Spinning? block is used to report if the selected V5 Smart Motor or Motor Group is currently moving.
<[ClawMotor v] is spinning?>
The Motor is Spinning? block reports True
when the selected Motor or Motor Group is moving.
The Motor is Spinning? block reports False
when the selected Motor or Motor Group is not moving.
Choose which Motor or Motor Group to use.
Position of Motor#
The Position of Motor block is used to report the distance an V5 Smart Motor or the first motor of a Motor Group has traveled.
([Motor3 v] position in [degrees v])
Choose which Motor or Motor Group to use.
Choose the units to report in, degrees or turns.
In this example, the Motor will spin forward for 1 second before its current position is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current position after 1 second.]
print ([Motor3 v] position in [degrees v]) on [Brain v] ◀ and set cursor to next row
Velocity of Motor#
The Velocity of Motor block is used to report the current velocity of an V5 Smart Motor or the first motor of a Motor Group.
([Motor3 v] velocity in [% v])
The Velocity of Motor block reports a range from -100% to 100% or -600rpm to 600rpm.
Choose which Motor or Motor Group to use.
Choose the units to report in, percent (%) or rotations per minute (rpm).
In this example, the Motor will spin forward for 1 second before its current velocity is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current velocity after 1 second.]
print ([Motor3 v] velocity in [% v]) on [Brain v] ◀ and set cursor to next row
Current of Motor#
The Current of Motor block is used to report the amount of current a V5 Smart Motor or Motor Group is drawing in amperes (amps).
([Motor3 v] current in amps)
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current after 1 second.]
print ([Motor3 v] current in amps) on [Brain v] ◀ and set cursor to next row
Power of Motor#
The Power of Motor block is used to report the amount of power output a V5 Smart Motor or the first motor of a Motor Group is currently generating.
([Motor3 v] power in watts)
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current power is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current power after 1 second.]
print ([Motor3 v] power in watts) on [Brain v] ◀ and set cursor to next row
Torque of Motor#
The Torque of Motor block is used to report the amount of torque (rotational force) a V5 Smart Motor or the first motor of a Motor Group is currently using.
([Motor3 v] torque in [Nm v])
The Torque of Motor block reports a range from 0.0 to 18.6 inch-pounds (InLB) or 0.0 to 2.1 Newton-meters (Nm).
Choose which Motor or Motor Group to use.
Choose the units to report in, Nm or InLb.
In this example, the Motor will spin forward for 1 second before its current torque is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current torque after 1 second.]
print ([Motor3 v] torque in [Nm v]) on [Brain v] ◀ and set cursor to next row
Efficiency of Motor#
The Efficiency of Motor block is used to report the efficiency of a V5 Smart Motor or the first motor of a Motor Group.
([Motor3 v] efficiency in %)
The Efficiency of Motor block reports a range from 0% to 100%, determined by the value of the power (in watts) the motor is using (input), versus the amount of power (in watts) the motor is providing (output).
An V5 Smart Motor or Motor Group typically reaches a maximum efficiency of 65% under normal use cases.
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current efficiency is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current efficiency after 1 second.]
print ([Motor3 v] efficiency in %) on [Brain v] ◀ and set cursor to next row
Temperature of Motor#
The Temperature of Motor block is used to report the temperature of a V5 Smart Motor or the first motor of a Motor Group.
([Motor3 v] temperature in % :: #5cb0d6)
The Temperature of Motor block reports a range from 0% to 100%.
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current temperature is printed on the Brain’s screen.
when started :: hat events
[Spin Motor3 forward for 1 second.]
spin [Motor3 v] [forward v]
wait (1) seconds
[Print Motor3's current temperature after 1 second.]
print ([Motor3 v] temperature in % :: #5cb0d6) on [Brain v] ◀ and set cursor to next row