区块#
本指南详细介绍了如何使用 VEXcode VR 中的“块”。您将学习如何阅读和理解每个块,并了解其详尽的描述、参数和使用示例。
理解区块条目#
API 参考中的每个块条目都包含以下组件:
块名称和图像:这是块的名称和块的图像。
描述:对该块功能的简要说明。
参数:屏幕截图显示了该块的所有可用参数以及扩展的下拉菜单。
示例:提供一个图像,演示如何在 VEXcode 中使用该块。
块条目示例#
The drive block moves the drivetrain forward or in reverse using the current drive velocity. This block runs continuously until another Drivetrain block interrupts it or the project stops.
驱动 [向前 v]
Parameters |
Description |
|---|---|
direction |
The direction the robot drives:
|
Example
当开始 :: hat events
[Drive forward, then stop.]
驱动 [向前 v]
等待 (2) 秒
驱动停止
子部分中的块#
某些模块位于与其特定传感器或功能相关的特定子部分中。例如,与计时器、传感器或电机相关的模块将相应地分组。有关这些模块的详细信息,请参阅这些子部分。