LED指示灯#

介绍#

LED 指示灯 允许 V5 主机通过 3 线端口打开或关闭连接的发光二极管 (LED)。

绿色 VEX V5 LED 指示灯。

本页面使用 led_a 作为示例 LED 指示灯名称。您可以根据需要将其替换为您自己配置的名称。

以下是可用方法列表:

  • on – 打开指定的 LED 指示灯。

  • off – 关闭指定的 LED 指示灯。

构造函数 – 手动初始化 LED 指示灯。

  • Led – 创建一个 LED 指示灯。

在#

on ,指定的 LED 指示灯亮起。

Usage:
led_a.on()

参数

描述

此方法没有参数。

离开#

off 关闭指定的 LED 指示灯。

Usage:
led_a.off()

参数

描述

此方法没有参数。

构造函数#

构造函数用于手动创建 Led 对象,这是在 VEXcode 之外配置 LED 指示器所必需的。

Led#

Led 创建一个 LED 指示灯。

Usage:
Led(port)

范围

描述

port

The 3-Wire Port that the LED Indicator is connected to:

  • On the V5 Brain – brain.three_wire_port.x where x is the number of the port.
  • On a 3-Wire Expander – expander.a where expander is the name of the expander instance.

# Create an LED Indicator in Port A
led_a = Led(brain.three_wire_port.a)