Brain Sensing#

Introduction#

The Brain Sensing category includes blocks that detect input from the VEX IQ (1st gen) Brain and report internal system values. These blocks allow your project to respond to button presses, monitor battery status, and determine the current screen cursor position when printing.

These blocks are often used in tandem with visual feedback tools such as the Screen or Console blocks, helping create interactive or responsive programs during runtime.

Below is a list of all blocks:

  • brain button pressed? — Returns a Boolean indicating whether a specific brain button is currently pressed.

  • battery capacity — Returns the current battery level as a percentage.

  • when Brain button — Executes the attached stack of blocks when a brain button is pressed or released.

brain button pressed?#

The brain button pressed? block returns a Boolean indicating if a brain button is currently being pressed.

  • True — The specified button is being pressed.

  • False — The specified button is not being pressed

<¿Botón del cerebro [▲ v] presionado?>

Parameters

Description

button

The button to check for a press or release:

  • Check

Example

cuando empezó
[Spin when a Brain button is pressed.]
esperar hasta <¿Botón del cerebro [▲ v] presionado?>
girar [derecha v] por (360) grado ▶

battery capacity#

The battery capacity block returns the battery charge level as a percentage. This returns a number from 0 to 100.

(battery capacity in %)

Parameters

Description

This block has no parameters.

Example

cuando empezó
[Display the current battery capacity.]
imprimir (battery capacity in %) en la pantalla ◀ y coloque el cursor en la siguiente fila

when Brain button#

The when Brain button block runs the attached stack of blocks when the selected brain button is pressed or released.

When brain button event hat block#
cuando Cerebro [▲ v] botón [presionado v]

Parameters

Description

buttons

Determines which button will trigger the event:

  • Check

action

Determines when the attached stack of blocks will execute:

  • pressed
  • released

Example

When the screen is pressed, the brain displays a text.#
cuando Cerebro [▲ v] botón [presionado v]
[Display a text when the ▲ button is pressed.]
imprimir [Hello, IQ!] en la pantalla ◀ y coloque el cursor en la siguiente fila