Imán#
Introducción#
El imán VEX VR permite que tu robot interactúe con objetos magnéticos, recogiéndolos y soltándolos.
A continuación se muestra una lista de todos los métodos disponibles:
Acciones: Activar o desactivar el imán.
energize– Sets the magnet to pick up or drop objects.
Comportamiento#
energize#
energize sets the state of the magnet so it can pick up or drop objects.
Usage:
magnet.energize(action)
Parámetros |
Descripción |
|---|---|
|
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)