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#

The Brain button pressed Boolean block reports whether a brain button is currently being pressed.

  • True — The specified button is being pressed.

  • False — The specified button is not being pressed.

    <Brain [▲ v] button pressed?>

Parameters

Description

button

The button to check for a press:

  • Check

Example

    when started
    [Spin when a Brain button is pressed.]
    wait until <Brain [▲ v] button pressed?>
    turn [right v] for (360) degrees ▶

battery capacity#

The battery capacity reporter block reports the battery level, as a percentage from 0% to 100%.

    (battery capacity in %)

Parameters

Description

This block has no parameters.

Example

    when started
    [Display the current battery capacity.]
    print (battery capacity in %) on screen ◀ and set cursor to next row

when Brain button#

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

When brain button event hat block#
    when Brain [▲ v] button [pressed v]

Parameters

Description

buttons

Determines which button will trigger the event:

  • Check

action

Determines when the attached stack of blocks will execute: pressed will run when a button is pressed, and released will run when a button is released.

Example

When the screen is pressed, the brain displays a text.#
    when Brain [▲ v] button [pressed v]
    [Display a text when the ▲ button is pressed.]
    print [Hello, IQ!] on screen ◀ and set cursor to next row