磁铁#

磁铁.energize()#

The magnet.energize(action) command is used to set the VR Robot Electromagnet’s current action.

这是一个非等待命令,允许任何后续命令无延迟地执行。

参数

描述

行动

The set status of the VR Robot Electromagnet as BOOST or DROP.

  • BOOST - will attract a nearby magnetic object to the Electromagnet.

  • DROP - will release any object the Electromagnet is holding.

**返回:**无。

def main():
    # Set the magnet to boost.
    magnet.energize(BOOST)
    # Wait 5 seconds.
    wait(5, SECONDS)
    # Set magnet to drop.
    magnet.energize(DROP)