Cerebro#

Inicializando la clase Brain#

Para utilizar el V5 Brain en su proyecto, comience inicializándolo de la siguiente manera:

# Create a new object "brain" with the Brain class.
brain = Brain()

This brain object will be used in all subsequent examples throughout this API documentation when referring to Brain class methods and attributes.

La clase Brain viene con cinco atributos predefinidos:

  • battery - Proporciona información sobre la batería del V5 Brain, incluida la capacidad, la temperatura, el voltaje y la corriente.

  • timer - Proporciona funcionalidad para medir el tiempo transcurrido y asignar funciones a eventos basados en el tiempo en el V5 Brain.

  • screen - Le permite mostrar texto, dibujar formas y asignar funciones táctiles en la pantalla del V5 Brain.

  • sdcard - Proporciona acceso a los archivos almacenados en la tarjeta SD del V5 Brain.

  • three_wire_port - Provides access to 3-Wire Sensors connected to the V5 Brain’s 3-Wire Ports. Each port is identified by a letter (a through h) and can be accessed using the format brain.three_wire_port.x, where x is the port letter. For example, brain.three_wire_port.a refers to the Sensor connected to port A.

Métodos de clase#

Además de sus atributos, la clase Brain proporciona un método que se puede utilizar directamente.

program_stop()#

The program_stop() method stops the currently running project.

Devoluciones: Ninguna.