AForge.Robotics.TeRK.Qwerk.Leds.SetLedState C# (CSharp) 메소드

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
            public void SetLedState( int led, LedState state )
            {
                if ( ( led < 0 ) || ( led >= Count ) )
                {
                    throw new ArgumentOutOfRangeException( "Invalid LED is specified." );
                }

                bool[] ledsMask = new bool[Count];
                LedState[] states = new LedState[Count];

                ledsMask[led] = true;
                states[led] = state;

                SetLedsState( ledsMask, states );
            }