Brain#
Introduction#
A VEX EXP 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 EXP Robot Battery, using the buttons, 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 EXP Robot Battery, such as voltage, current, and charge level.button– Allows detecting button presses and assigning functions to button events on the EXP Brain.screen– Allows drawing, printing, and interacting with the EXP 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 EXP Brain’s 3-Wire Ports. Each port is identified by a letter (athroughh).
This page uses brain as the example EXP 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 EXP Brain.
Brain– Creates a EXP Brain.
Note: A Brain is automatically created at the start of each VEXcode EXP 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 EXP Brain outside of VEXcode.
Brain#
Brain creates a Brain.
Usage:
Brain()
Parameters |
Description |
|---|---|
This constructor has no parameters. |
# Create a Brain
brain = Brain()