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- Provides information about the V5 Brain’s battery, including capacity, temperature, voltage, and current.timer- Provides functionality to measure elapsed time and assign functions to time-based events on the V5 Brain.screen- Enables you to display text, draw shapes, and assign touch-responsive functions on the V5 Brain’s Screen.sdcard- Provides access to files stored on the V5 Brain’s SD card.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 formatbrain.three_wire_port.x, wherexis the port letter. For example,brain.three_wire_port.arefers to the Sensor connected to port A.
Atributos
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.