private static void SendMessage(Ssd1306 device, string message) { device.SendCommand(new Ssd1306Cmnds.SetColumnAddress()); device.SendCommand(new Ssd1306Cmnds.SetPageAddress(Ssd1306Cmnds.PageAddress.Page0, Ssd1306Cmnds.PageAddress.Page3)); foreach (char character in message) { device.SendData(BasicFont.GetCharacterBytes(character)); } }
private static void SendMessage(Ssd1306 ssd1306, string message) { ssd1306.SendCommand(new SetColumnAddress()); ssd1306.SendCommand(new SetPageAddress(PageAddress.Page0, PageAddress.Page3)); foreach (char character in message) { ssd1306.SendData(BasicFont.GetCharacterBytes(character)); } }
private static void ClearScreen(Ssd1306 device) { device.SendCommand(new Ssd1306Cmnds.SetColumnAddress()); device.SendCommand(new Ssd1306Cmnds.SetPageAddress(Ssd1306Cmnds.PageAddress.Page0, Ssd1306Cmnds.PageAddress.Page3)); for (int cnt = 0; cnt < 32; cnt++) { byte[] data = new byte[16]; device.SendData(data); } }
private static void ClearScreen(Ssd1306 ssd1306) { ssd1306.SendCommand(new SetColumnAddress()); ssd1306.SendCommand(new SetPageAddress(PageAddress.Page0, PageAddress.Page3)); for (int cnt = 0; cnt < 32; cnt++) { byte[] data = new byte[16]; ssd1306.SendData(data); } }
// Display size 128x32. private static void Initialize(Ssd1306 device) { device.SendCommand(new SetDisplayOff()); device.SendCommand(new Ssd1306Cmnds.SetDisplayClockDivideRatioOscillatorFrequency(0x00, 0x08)); device.SendCommand(new SetMultiplexRatio(0x1F)); device.SendCommand(new Ssd1306Cmnds.SetDisplayOffset(0x00)); device.SendCommand(new Ssd1306Cmnds.SetDisplayStartLine(0x00)); device.SendCommand(new Ssd1306Cmnds.SetChargePump(true)); device.SendCommand( new Ssd1306Cmnds.SetMemoryAddressingMode(Ssd1306Cmnds.SetMemoryAddressingMode.AddressingMode .Horizontal)); device.SendCommand(new Ssd1306Cmnds.SetSegmentReMap(true)); device.SendCommand(new Ssd1306Cmnds.SetComOutputScanDirection(false)); device.SendCommand(new Ssd1306Cmnds.SetComPinsHardwareConfiguration(false, false)); device.SendCommand(new SetContrastControlForBank0(0x8F)); device.SendCommand(new Ssd1306Cmnds.SetPreChargePeriod(0x01, 0x0F)); device.SendCommand( new Ssd1306Cmnds.SetVcomhDeselectLevel(Ssd1306Cmnds.SetVcomhDeselectLevel.DeselectLevel.Vcc1_00)); device.SendCommand(new Ssd1306Cmnds.EntireDisplayOn(false)); device.SendCommand(new Ssd1306Cmnds.SetNormalDisplay()); device.SendCommand(new SetDisplayOn()); device.SendCommand(new Ssd1306Cmnds.SetColumnAddress()); device.SendCommand(new Ssd1306Cmnds.SetPageAddress(Ssd1306Cmnds.PageAddress.Page1, Ssd1306Cmnds.PageAddress.Page3)); }
private static void ResetPageColumnAddress(Ssd1306 device) { device.SendCommand(new Ssd1306Cmnds.SetColumnAddress(0x20, 0x5f)); device.SendCommand(new Ssd1306Cmnds.SetPageAddress(Ssd1306Cmnds.PageAddress.Page0, Ssd1306Cmnds.PageAddress.Page3)); }