Exemple #1
0
        private void ButtonPin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs events)
        {
            lcd.gotoSecondLine();
            var text   = events.Edge.ToString();
            var length = text.Length;

            UpdateGui(text);

            if (length < 16)
            {
                text += new String(' ', 16 - length);
            }
            lcd.prints(text);
            if (events.Edge == GpioPinEdge.FallingEdge)
            {
                ToggleLed();
            }
        }
Exemple #2
0
        private void DisplayMessage(string message)
        {
            lcdDisplay.clrscr();
            if (!String.IsNullOrWhiteSpace(message))
            {
                if (message.Length < 17)
                {
                    lcdDisplay.prints(message);
                }
                else
                {
                    var msgPart = message.Substring(0, 16);//new String(message.Take(17).ToArray());
                    lcdDisplay.prints(msgPart);

                    msgPart = message.Substring(16);
                    lcdDisplay.gotoSecondLine();
                    lcdDisplay.prints(msgPart);
                }
            }
        }