区块#

This guide provides detailed information on how to use Blocks in VEXcode IQ (1st gen). Here, you will learn how to read and understand each block, with comprehensive descriptions, parameters, and usage examples.

理解区块条目#

API 参考中的每个块条目都包含以下组件:

  • 块名称和图像:这是块的名称和块的图像。

  • 描述:对该块功能的简要说明。

  • Parameters: A table showing all the available parameters for that block with expanded drop-downs.

  • 示例:提供一个图像,演示如何在 VEXcode 中使用该块。

块条目示例#

drive#

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 in which the robot drives:

  • forward
  • reverse

Example

当开始
[Drive forward, then stop.]
驱动 [向前 v]
等待 (2) 秒
驱动停止