数字输出#
介绍#
数字输出 3 线设备允许 V5 主控单元向外部组件(如 LED、继电器或其他电子设备)发送数字信号(高或低)。
This page uses dig_out as the example Digital Out device name. Replace it with your own configured name as needed.
以下是可用方法列表:
set– Sets the signal level of a 3-Wire Digital Out port to high or low.
构造函数 – 手动初始化和配置数字输出设备。
DigitalOut– Create a Digital Out device.
放#
set outputs a high or low signal to the connected Digital Out device.
Usage:
dig_out.set(boolean)
范围 |
描述 |
|---|---|
|
Whether to send a high or low signal:
|
# Send out a low signal from dig_out
dig_out.set(False)
构造函数#
Constructors are used to manually create DigitalOut objects, which are necessary for configuring a Digital Out device outside of VEXcode.
DigitalOut#
DigitalOut creates a Digital Out device.
Usage:
DigitalOut(port)
范围 |
描述 |
|---|---|
|
The 3-Wire Port that the Digital Out device is connected to:
|
# Create a Digital Out device in Port A
dig_out = DigitalOut(brain.three_wire_port.a)