Exemplo n.º 1
0
        /// <summary>
        /// Read the state of the input pins. Will trigger any Onchanged events registered.
        /// </summary>
        public void PollInputPins()
        {
            var result = this.spiConnection.Transfer(this.inputPollBuffer);
            var state  = this.inputPollBuffer.Rx[2];

            if (state != this.cachedInputState)
            {
                this.cachedInputState = state;
                PiFaceInputPin.SetAllPinStates(this.InputPins, state);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InputPinChangedArgs"/> class.
 /// </summary>
 /// <param name="pin">The pin.</param>
 public InputPinChangedArgs(PiFaceInputPin pin)
 {
     this.Pin = pin;
 }