Example #1
0
        public Relay(Int32 delayMilliseconds = 0, Boolean invert = false)
        {
            if (delayMilliseconds < 0)
            {
                throw new ArgumentException("Delay time must be larger than or equal to 0");
            }

            _deplayMilliseconds = delayMilliseconds;
            _invertBit          = Convert.ToInt32(invert);
            Input                   = new InputEndpoint();
            Input.Receive          += OnReceive;
            InputOfContact          = new InputEndpoint();
            InputOfContact.Receive += OnReceive;
            Output                  = new OutputEndpoint();

            Input.Transmit(0);  //Relay can send signals from beginning. When being used in invert mode, it plays as power role.
        }
Example #2
0
 public IndicatorLight()
 {
     Input          = new InputEndpoint();
     Input.Receive += ReceivedSignal;
     Lighting       = false;
 }