控制器#
介绍#
VEX AIR 无人机控制器采用 12 个按钮布局和两个操纵杆。这些输入使无人机能够检测按钮按下和操纵杆移动,从而实现交互式和灵敏的控制。
以下是所有可用块的列表:
controller button pressed — Checks if a specific button is currently being pressed.
controller axis position — Reports the position of the joystick along a specified axis.
controller is connected — Reports whether the controller is connected to the drone.
controller battery level — Reports the controller’s battery level.
当控制器按钮时 — 按下或释放按钮时运行一堆块。
当控制器轴改变时 — 当操纵杆位置改变时运行一堆块。
控制器轴位置#
The controller axis position reporter block reports the position of the specified joystick axis. This reports an integer from –100 to 100.
(控制器轴 [1 v] 位置)

参数 |
描述 |
|---|---|
轴 |
报告位置的轴:
|
例子
当开始
[Climb when the left joystick is moved up.]
起飞至 [500] [毫米 v] ▶
永久循环
如果 <(控制器轴 [1 v] 位置) [math_greater_than v] [0]> 那么
爬升 [向上 v]
否则
徘徊
结束
controller is connected#
The controller is connected Boolean block reports if the controller is connected to the drone.
True — The controller is connected.
False — The controller is not connected.
<控制器是否连接到无人机?>
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Print controller connection status on screen.]
永久循环
如果 <控制器是否连接到无人机?> 那么
清屏
在屏幕上设定光标至 (1) 行 (1) 列
在屏幕上打印 [Controller connected]▶
等待 (0.5) 秒
结束
结束
控制器电池电量#
The controller battery level reporter block reports the battery level of the controller, as a percentage from 0% to 100%.
(控制器电池电量百分比)
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Show controller's battery level.]
如果 <(控制器电池电量百分比) [math_greater_than v] [50]> 那么
在屏幕上打印 [Battery level ok]▶
否则
在屏幕上打印 [Battery level low]▶
当控制器轴改变时#
The when controller axis is changed hat block runs the attached stack of blocks when the specified axis is being changed.
当遥控器 [1 v] 轴改变

参数 |
描述 |
|---|---|
轴 |
The axis to monitor for changes:
|
例子
当开始
[Move forward when the left joystick moves.]
起飞至 [500] [毫米 v] ▶
当遥控器 [1 v] 轴改变
将 [向前 v] 移至 (200) [毫米 v] ▶
