private void SetPinState(bool state) { if (_pinObject != null && !_pinObject.IsDisposed) { _pinObject.Write(state); } }
/// <summary> /// Write either command or data, with automatic 4/8-bit selection /// </summary> /// <param name="value">value to write</param> /// <param name="mode">Mode for RS (register select) pin.</param> /// <param name="backlight">Backlight state.</param> public void Send(byte value, bool mode, bool backlight) { if (_disposed) { throw new ObjectDisposedException("NetopiaGPIOLcdTransferProvider"); } //TODO: set backlight _rsPort.Write(mode); // if there is a RW pin indicated, set it low to Write if (_rwPort != null) { _rwPort.Write(false); } if (!_fourBitMode) { Write8Bits(value); } else { Write4Bits((byte)(value >> 4)); Write4Bits(value); } }
private void PulseEnable() { _enablePort.Write(false); _enablePort.Write(true); // enable pulse must be >450ns _enablePort.Write(false); // commands need > 37us to settle }
public static void lightControll(bool onState) { lightReelay.Write(onState); System.Console.WriteLine(" PIN za svjetlo: " + onState); }