脑部感知#

介绍#

“脑机感应”类别包含一些模块,用于检测来自 VEX IQ(第一代)脑机的输入并报告内部系统值。这些模块可以让您的项目响应按钮按下操作、监控电池状态,并在打印时确定当前屏幕光标位置。

这些模块通常与 ScreenConsole 等视觉反馈工具配合使用,有助于在运行时创建交互式或响应式程序。

以下是所有模块的列表:

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] 键按下了?>

参数

描述

按钮

The button to check for a press:

  • Check

例子

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

电池容量#

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

(battery capacity in %)

参数

描述

此代码块没有参数。

例子

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

当大脑按钮#

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

当大脑按钮事件帽子块#
当Brain [▲ v] 按键 [pressed v]

参数

描述

按钮

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

  • 检查

行动

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.

例子

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