Brain#

Introduction#

Brain blocks allow your robot to report information about the battery connected to the EXP Brain, such as battery voltage, current, and charge capacity. These blocks also allow you to respond to button presses on the EXP Brain.

Below is a list of available blocks:

  • Brain button pressed — Reports whether a specific brain button is currently pressed.

  • Battery voltage – Reports the voltage of the EXP Brain’s battery.

  • Battery current – Reports the electrical current drawn from the battery.

  • battery capacity — Reports the brain’s current battery percentage.

  • when Brain button – Runs the attached stack of blocks when a specified button on the Brain is pressed or released.

Brain button pressed#

The Brain button pressed Boolean block reports whether a specified button on the Brain is currently being pressed.

  • True – The specified button on the Brain is being pressed.

  • False – The specified button on the Brain is not being pressed.

  <Brain [◀ v] button pressed?>

Parameter

Description

button

Which button to use:

  • Check

  when started
  [Display a message when the Brain's button is pressed.]
  wait until <Brain [Check v] button pressed?>
  print [Check was pressed!] on screen ▶

Battery voltage#

Voltage is the electrical pressure supplied to the battery. The Battery voltage reporter block reports the battery’s current voltage, which can help you check whether the battery is charged enough for the robot to run reliably, ranging from 7.0 to 8.0 Volts.

  (battery voltage in volts)

Parameters

Description

This block has no parameters.

Battery current#

Current is how much electrical flow the robot is using from the battery. The Battery current reporter block reports the battery’s current draw, which can help you see how hard the robot is working or whether motors may be under extra load, ranging from 0.0 to 15.0 Amps.

  (battery current in amps)

Parameters

Description

This block has no parameters.

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.

when Brain button#

The when Brain button block runs the attached stack when a specified button on the Brain is pressed or released.

  when Brain [◀ v] button [pressed v]  :: hat events

Parameter

Description

button

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.

Drive forward until an object is detected within 200 mm#
  when Brain [◀ v] button [pressed v]  :: hat events
  [Display a message when the Brain's button is pressed.]
  print [Left arrow pressed!] on screen ▶