Magnet#

magnet.energize()#

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

This is a non-waiting command and allows any subsequent commands to execute without delay.

Parameters

Description

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.

Returns: None.

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