磁铁#
Introduction#
The VEX VR Magnet lets your robot interact with magnetic objects by picking them up and releasing them.
Below is a list of all available methods:
Actions – Enable or disable the magnet.
energize– Sets the magnet to pick up or drop objects.
Actions#
energize#
energize sets the state of the magnet so it can pick up or drop objects.
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)