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)