コード例 #1
0
 private static void SendMessage(Ssd1306 device, string message)
 {
     foreach (char character in message)
     {
         device.SendData(BasicFont.GetCharacterBytes(character));
     }
 }
コード例 #2
0
        private static void SendMessageLine(Ssd1306 device, string message)
        {
            int bytesSend = 0;

            foreach (char character in message)
            {
                byte[] chars = BasicFont.GetCharacterBytes(character);
                device.SendData(chars);
                bytesSend += chars.Length;
            }

            int bytesDiff = Math.Abs(bytesSend - 64);

            byte[] bytesComplete = new byte[bytesDiff];
            device.SendData(bytesComplete);
        }