旋转传感器#

介绍#

The Rotation Sensor measures the rotation of a shaft. It can be used anywhere on a robot where a shaft is rotating, even if that shaft is not connected directly to a motor.

A motor has a built-in encoder that can track its own rotation. The Rotation Sensor works like an external encoder that can track the rotation of a separate shaft.

The Rotation Sensor can report the shaft’s angle, position, and velocity. Angle is the shaft’s absolute position from 0 to 359.99 degrees. It does not reset when a project starts or when the robot is powered off. Position tracks how many degrees or turns the shaft has rotated forward or reverse during a project, and it can be reset as needed.

The Rotation Sensor is compatible with 1/8 inch and 1/4 inch standard VEX shafts.

VEX V5 旋转传感器。

以下是可用模块列表:

set Rotation position#

The set Rotation position stack block sets the Rotation Sensor’s current position to a value in degrees.

Position is how far the shaft has rotated during a project. Setting the position changes the current position value without moving the shaft.

设定 [Rotation 1 v] 位置为 [0] 度

参数

描述

设备

The Rotation Sensor to use. Choose from the Rotation Sensors configured in the Devices window.

位置

The position value to assign to the Rotation Sensor, in degrees. This can be an integer or a decimal.

Rotation angle#

The Rotation angle reporter block reports the shaft’s current angle from 0 to 359.99 degrees.

Angle reports the shaft’s absolute position within one rotation. It does not reset when a project starts or when the robot is powered off.

([Rotation 1 v] 角度值)

参数

描述

设备

The Rotation Sensor to use. Choose from the Rotation Sensors configured in the Devices window.

Rotation position#

The Rotation position reporter block reports the shaft’s total rotational position.

Unlike angle, position can increase past 359.99 degrees or decrease below 0 degrees. Position tracks how far the shaft rotates forward or reverse during a project and can be reset as needed.

([Rotation 1 v] 转位 [度 v] :: custom-sensing)

参数

描述

设备

The Rotation Sensor to use. Choose from the Rotation Sensors configured in the Devices window.

单位

The position unit: degrees or turns.

Rotation velocity#

The Rotation velocity reporter block reports how fast the shaft is rotating.

([Rotation 1 v] 速度 [rpm v] 值 :: custom-sensing)

参数

描述

设备

The Rotation Sensor to use. Choose from the Rotation Sensors configured in the Devices window.

单位

The velocity unit: rpm (revolutions per minute) or dps (degrees per second).