예제 #1
0
 /// <summary>Displays a message on the LCD</summary>
 /// <param name="messageFirstLine">The message to be displayed on the first line of the LCD</param>
 /// <param name="messageSecondLine">The message to be displayed on the second line of the LCD</param>
 private static void DisplayMessage(string messageFirstLine = "", string messageSecondLine = "")
 {
     if (SerialLcd != null)
     {
         SerialLcd.Clear();
         SerialLcd.Write(messageFirstLine);
         SerialLcd.Write(0, 1, messageSecondLine);
     }
 }
예제 #2
0
        private LcdWriter()
        {
            _serialInterface = new SerialLcd(SerialPorts.COM2);

            ThreadUtil.Start(() =>
            {
                while (true)
                {
                    _serialInterface.ClearDisplay();
                    _serialInterface.SetCursorPosition(1, 1);

                    lock (_lockObject)
                    {
                        _serialInterface.Write(_lcdDisplay);
                    }

                    mutex.WaitOne();
                }
            });
        }