磁铁#
介绍#
VEX VR Magnet 可以让你的机器人通过拾取和释放磁性物体来与它们进行交互。
以下是所有可用方法的列表:
操作 – 启用或禁用磁铁。
energize– 设置磁铁拾取或放下物体。
行动#
energize#
energize 设置磁铁的状态,使其能够拾取或放下物体。
Usage:
magnet.energize(action)
参数 |
描述 |
|---|---|
|
The state of the magnet to set:
|
def main():
# Pick up and drop off a disk
drivetrain.drive_for(FORWARD, 800, MM)
magnet.energize(BOOST)
drivetrain.drive_for(REVERSE, 800, MM)
magnet.energize(DROP)
# VR threads — Do not delete
vr_thread(main)