private static void SendMessage(Ssd1306 device, string message) { foreach (char character in message) { device.SendData(BasicFont.GetCharacterBytes(character)); } }
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); }