Táscaire LED#

Réamhrá#

Leis an rang led , is féidir leis an V5 Brain dé-óid astaithe solais (LED) ceangailte a chasadh air nó as ag baint úsáide as Port 3-Sreang.

An táscaire LED glas VEX V5.

Tógálaí Ranga#

led(
  triport::port &port );

Scriostóir Ranga#

Scriosann sé an réad led agus scaoileann sé acmhainní gaolmhara.

virtual ~led();

Paraiméadair#

Paraiméadar

Cineál

Cur síos

port

triport::port &

An Port 3-Sreang a bhfuil an Táscaire LED ceangailte leis, scríofa mar Brain.ThreeWirePort.X nó ExpanderName.X, áit a seasann X do litir an phoirt (mar shampla, Brain.ThreeWirePort.A nó Expander1.A).

Samplaí#

// Create an led instance in Port A
led LEDA = led(Brain.ThreeWirePort.A);

Feidhmeanna na mBall#

Áirítear leis an rang led na feidhmeanna ball seo a leanas:

  • on — Casann sé an Táscaire LED sonraithe air.

  • off — Múchann sé an Táscaire LED sonraithe.

Sula nglaotar ar aon fheidhmeanna led ball, ní mór sampla led a chruthú, mar a thaispeántar thíos:

/* 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#

Casann sé an Táscaire LED sonraithe air.

Available Functions
void on();

Parameters

Ní ghlacann an fheidhm seo le haon pharaiméadair.

Return Values

Ní thugann an fheidhm seo luach ar ais.

Examples
// Turn on the LED
LEDA.on();

// Wait 2 seconds
wait(2, seconds);

// Turn off LED
LEDA.off();

off#

Múchann sé an Táscaire LED sonraithe.

Available Functions
void off();

Parameters

Ní ghlacann an fheidhm seo le haon pharaiméadair.

Return Values

Ní thugann an fheidhm seo luach ar ais.

Examples
// Turn on the LED
LEDA.on();

// Wait 2 seconds
wait(2, seconds);

// Turn off LED
LEDA.off();