大脑感知#

介绍#

Brain Sensing 类别包含可检测 VEX IQ(第二代)Brain 输入并报告内部系统值的模块。这些模块可让您的项目响应按钮按下、监控电池状态,并在打印时确定当前屏幕光标位置。

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.

大脑按钮被按下了吗?#

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

<Brain [ 键按下了?>

参数

描述

按钮

用于检查按下或释放的按钮:

  • 检查

例子

当开始
[Spin when a Brain button is pressed.]
等到 <Brain [ 键按下了?>
[右 v] 转 (360) 度 ▶

电池容量#

电池容量 模块以百分比形式返回电池电量。它会返回一个 0 到 100 之间的数字。

(battery capacity in %)

参数

描述

该块没有参数。

例子

当开始
[Display the current battery capacity.]
在屏幕上打印 (battery capacity in %)◀ 并设定光标为下一行

当大脑按钮#

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

当大脑按钮事件帽子块#
当Brain [ 按键 %2

参数

描述

按钮

决定哪个按钮将触发事件:

  • 检查

行动

确定附加的块堆栈何时执行:

  • 按下
  • 释放

例子

当按下屏幕时,大脑就会显示一段文字。#
当Brain [ 按键 %2
[Display a text when the ◀ button is pressed.]
在屏幕上打印 [Hello, IQ!]◀ 并设定光标为下一行