控制器#
介绍#
The One Stick Controller features a 4-button layout and a joystick that functions as both an analog input and a pressable button. These inputs allow the robot to detect button presses and joystick movements, enabling interactive and responsive control.
Below is a list of all blocks:
controller button pressed? — Checks if a specific button is currently being pressed.
controller axis position — Returns the position of the joystick along a specified axis.
when controller button — Runs a stack of blocks when a button is pressed or released.
when controller axis is changed — Runs a stack of blocks when the joystick position changes.
控制器轴位置#
控制器轴位置块以 -100 到 100 之间的整数返回操纵杆沿指定轴的位置。

(控制器轴 [1 v] 位置)
参数 |
描述 |
|---|---|
轴 |
返回位置的轴:
|
例子
当开始
[Move forward when the joystick is moved up.]
永久循环
如果 <(控制器轴 [1 v] 位置) [math_greater_than v] [0]> 那么
移动 [向前 v]
否则
停止移动
当控制器轴改变时#
当轴发生变化时,当控制器轴发生变化时块会激活附加的块堆栈。

当遥控器 [1 v] 轴改变
参数 |
描述 |
|---|---|
轴 |
要检查变化的轴:
|
例子
当遥控器 [1 v] 轴改变
[Move forward when the joystick is moved.]
将 [向前 v] 移至 [50] [毫米 v] ▶
