CyrusBuilt.MonoPi.Sensors.DS1620.SendCommand C# (CSharp) Method

SendCommand() private method

Sends an 8-bit command to the DS1620.
private SendCommand ( Int32 command ) : void
command System.Int32 /// The command to send. ///
return void
		private void SendCommand(Int32 command) {
			// Send command on data output, least sig bit first.
			Int32 bit = 0;
			for (Int32 n = 0; n < 8; n++) {
				bit = ((command >> n) & (0x01));
				this._data.Write((bit == 1) ? PinState.High : PinState.Low);
				this._clock.Write(PinState.Low);
				this._clock.Write(PinState.High);
			}
		}