Botón#

Introducción#

El robot VEX 123 tiene cuatro botones: Izquierda, Derecha, Mover y Sonido. Los métodos de los botones comprueban si se está pulsando alguno.

A continuación se muestra una lista de todos los métodos:

Obtención: Comprueba si se ha pulsado un botón.

  • get_button — Returns whether a specified button is currently being pressed.

Adquiridor#

get_button#

get_button returns a Boolean that reports whether the specified button is currently being pressed.

  • True — The button is being pressed.

  • False — The button is not being pressed.

Usage:
robot.get_button(button)

Parámetro

Descripción

button

The button to check:

  • LEFT
  • MOVE
  • RIGHT
  • SOUND

# Drive after the sound button is pressed.
while not robot.get_button(SOUND):
    wait(0.05, SECONDS)
robot.drive(FORWARD)