C# Класс AForge.Robotics.TeRK.Qwerk.Leds

Provides access to Qwerk's on-board LEDs.

The class allows to manipulate Qwerk's on-boar LED's. The total number of available on-board LEDs equals to Leds.Count.

Sample usage:

// get Qwerk's LEDs service Qwerk.Leds leds = qwerk.GetLedsService( ); // turn off all LEDs leds.SetLedsState( Qwerk.LedState.Off ); // set zero LED to blinking state leds.SetLedState( 0, Qwerk.LedState.Blinking ); // turn on 4th and 5th LEDs bool[] mask = new bool[10] { false, false, false, false, true, true, false, false, false, false }; Qwerk.LedState[] states = new Qwerk.LedState[10] { Qwerk.LedState.Off, Qwerk.LedState.Off, Qwerk.LedState.Off, Qwerk.LedState.Off, Qwerk.LedState.On, Qwerk.LedState.On, Qwerk.LedState.Off, Qwerk.LedState.Off, Qwerk.LedState.Off, Qwerk.LedState.Off }; leds.SetLedsState( mask, states );
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Leds ( AForge.Robotics.TeRK.Qwerk qwerk )

Initializes a new instance of the Qwerk.Leds class.

SetLedState ( int led, LedState state ) : void

Set state of specified LED.

The method sets state of one of Qwerk's LEDs, which index is specified.

SetLedsState ( LedState state ) : void

Set state of all LEDs.

The method sets the same state to all Qwerk's on-board LEDs.

SetLedsState ( bool ledsMask, LedState states ) : void

Set state of all LEDs.

The ledsMask and states arrays specify which Qwerk's on-board LED's state should be updated. If value of the ledsMask array is set to , then corresponding LED's state is changed to the state, which is specified in states array.

Описание методов

Leds() публичный метод

Initializes a new instance of the Qwerk.Leds class.
The passed reference to object is not connected to /// Qwerk board. Failed connecting to the requested service. Failed accessing to the requested service.
public Leds ( AForge.Robotics.TeRK.Qwerk qwerk )
qwerk AForge.Robotics.TeRK.Qwerk Reference to object, which is connected to Qwerk board.

SetLedState() публичный метод

Set state of specified LED.

The method sets state of one of Qwerk's LEDs, which index is specified.

Invalid LED is specified. No connection to Qwerk or its service. Connestion to Qwerk is lost.
public SetLedState ( int led, LedState state ) : void
led int LED to set state for, [0, ).
state LedState LED's state to set.
Результат void

SetLedsState() публичный метод

Set state of all LEDs.

The method sets the same state to all Qwerk's on-board LEDs.

No connection to Qwerk or its service. Connestion to Qwerk is lost.
public SetLedsState ( LedState state ) : void
state LedState State, which will be set to all LEDs.
Результат void

SetLedsState() публичный метод

Set state of all LEDs.

The ledsMask and states arrays specify which Qwerk's on-board LED's state should be updated. If value of the ledsMask array is set to , then corresponding LED's state is changed to the state, which is specified in states array.

Incorrect length of LEDs' masks or states array. No connection to Qwerk or its service. Connestion to Qwerk is lost.
public SetLedsState ( bool ledsMask, LedState states ) : void
ledsMask bool Mask array specifying which LED's state need to be set.
states LedState Array of LEDs' states.
Результат void