Salida digital#
Introducción#
The digital_out class is used to control digital output signals on a VEX V5 3-Wire port. It allows a device to set a connected output to either a high or low state.
Constructores de clases#
digital_out(
triport::port &port );
Instructor de clase#
Destroys the digital_out object and releases associated resources.
~digital_out();
Parámetros#
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
The 3-Wire Port that the Digital Output device is connected to, written as |
Ejemplo#
// Create the digital_out instance on 3-Wire Port A
digital_out DigitalOutA = digital_out(Brain.ThreeWirePort.A);
Funciones de los miembros#
The digital_out class includes the following member functions:
set— Outputs a high or low signal to the connected Digital Out device.
Before calling any digital_out member functions, a digital_out instance must be created, as shown below:
/* 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#
Envía una señal alta o baja al dispositivo de salida digital conectado.
Available Functionsvoid set(
bool value );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
Whether to send a high or low signal:
|
Esta función no devuelve ningún valor.
Examples// Set the Digital Output to true
DigitalOutA.set(true);
// Set the Digital Output to false
DigitalOutA.set(false);