LED Indicator#
Introduction#
The led class is used to turn an LED Indicator on and off.
Class Constructor#
led(
triport::port &port );
Class Destructor#
Destroys the led object and releases associated resources.
virtual ~led();
Parameters#
Parameter |
Type |
Description |
|---|---|---|
|
|
The 3-Wire Port that the LED Indicator is connected to, written as |
Examples#
// Create an led instance in Port A
led LEDA = led(Brain.ThreeWirePort.A);
Member Functions#
The led class includes the following member functions:
Before calling any led member functions, a led instance must be created, as shown below:
/* This constructor is required when using VS Code.
LED Indicator configuration is generated automatically
in VEXcode using the Device Menu. Replace the values
as needed. */
// Create an led instance in Port A
led LEDA = led(Brain.ThreeWirePort.A);
on#
Turns the LED Indicator on.
Available Functionsvoid on();
This function does not accept any parameters.
Return ValuesThis function does not return a value.
Examples// Turn on the LED
LEDA.on();
// Wait 2 seconds
wait(2, seconds);
// Turn off LED
LEDA.off();
off#
Turns the LED Indicator off.
Available Functionsvoid off();
This function does not accept any parameters.
Return ValuesThis function does not return a value.
Examples// Turn on the LED
LEDA.on();
// Wait 2 seconds
wait(2, seconds);
// Turn off LED
LEDA.off();