Brain#
A VEX V5 Brain runs and manages all code in a project. It provides five main properties you can use in your code, including reading data from the V5 Robot Battery, using the touchscreen, accessing an inserted SD card, tracking time with a built-in timer, and interacting with devices connected to the 3-Wire ports.
Below is a list of available properties:
battery– Provides access to information about the V5 Robot Battery, such as voltage, current, and charge level.screen– Allows drawing, printing, and interacting with the V5 Brain’s touchscreen.sdcard– Enables reading from and writing to files stored on an SD card inserted into the Brain.timer– Provides access to the Brain’s internal timer for measuring elapsed time during projects.three_wire_port- Provides access to 3-Wire devices connected to the V5 Brain’s 3-Wire Ports. Each port is identified by a letter (athroughh).
This page uses brain as the example V5 Brain name. Replace it with your own configured name as needed.
Below is a list of available methods:
program_stop– Immediately stops the currently running project.
Constructor – Manually initialize a V5 Brain.
Brain– Creates a V5 Brain.
Note: A Brain is automatically created at the start of each VEXcode V5 project.
program_stop#
program_stop immediately stops the currently running project.
Usage:
brain.program_stop()
Parameters |
Description |
|---|---|
This method has no parameters. |
Constructor#
Constructors are used to manually create Brain objects, which are necessary for configuring a V5 Brain outside of VEXcode.
Brain#
Brain creates a Brain.
Usage:
Brain()
Parameters |
Description |
|---|---|
This constructor has no parameters. |
# Create a Brain
brain = Brain()