디지털 출력#
소개#
digital_out 클래스는 V5 브레인이 LED, 릴레이 또는 기타 전자 장치와 같은 외부 구성 요소로 디지털 신호를 보낼 수 있도록 합니다. 높은 신호(5볼트) 또는 낮은 신호(0볼트)를 보낼 수 있습니다.
클래스 생성자#
digital_out(
triport::port &port );
클래스 소멸자#
digital_out 객체를 파괴하고 관련 리소스를 해제합니다.
~digital_out();
매개변수#
매개변수 |
유형 |
설명 |
|---|---|---|
|
|
디지털 출력 장치가 연결된 3선 포트는 |
예#
// Create the digital_out instance on 3-Wire Port A
digital_out DigitalOutA = digital_out(Brain.ThreeWirePort.A);
회원 기능#
digital_out 클래스에는 다음과 같은 멤버 함수가 포함되어 있습니다.
set— 3선 디지털 출력 포트의 신호 레벨을 높음 또는 낮음으로 설정합니다.
digital_out 함수를 호출하기 전에 아래와 같이 digital_out 를 생성해야 합니다.
/* This constructor is required when using VS Code.
Digital output configuration is generated automatically
in VEXcode using the Device Menu. Replace the values
as needed. */
// Create the digital_out instance on 3-Wire Port A
digital_out DigitalOutA = digital_out(Brain.ThreeWirePort.A);
set#
선택한 3선 포트의 신호 레벨을 설정합니다.
Available Functionsvoid set(
bool value );
매개변수 |
유형 |
설명 |
|---|---|---|
|
|
높은 신호 또는 낮은 신호를 보낼지 여부: |
이 함수는 값을 반환하지 않습니다.
Examples// Set the Digital Output to true
DigitalOutA.set(true);
// Set the Digital Output to false
DigitalOutA.set(false);