private void ReleaseClockLock() { DatPin.Write(GpioPinValue.Low); for (int count = 0; count < 32; count++) { ClockPin.Write(GpioPinValue.High); ClockPin.Write(GpioPinValue.Low); } }
private void write_byte(byte input) { int value; byte modded = Convert.ToByte(input); for (int count = 0; count < 8; count++) { value = modded & 128; DatPin.Write(value == 128 ? GpioPinValue.High : GpioPinValue.Low); ClockPin.Write(GpioPinValue.High); modded = Convert.ToByte((modded << 1) % 256); ClockPin.Write(GpioPinValue.Low); } }