public override void Clear() { for (int i = 0; i < _characters.Length; i++) { for (int j = 0; j < _characters[i].Length; j++) { _characters[i][j] = (char)0; } } // display clear Device.WriteControl(Seq, 1, Multiplier); LCDOnLPTModule.Wait(uiDelayLong, Multiplier); }
public void WriteData(LCDSeq lcd, int data, int multiplier) { Output(_lptControl, RS ^ CTRL_MASK); Output(_lptData, data); LCDOnLPTModule.Wait(LPTLCD.uiDelayBus, multiplier); if (lcd == LCDSeq.LCD1) { Output(_lptControl, (RS | E1) ^ CTRL_MASK); } else { Output(_lptControl, (RS | E2) ^ CTRL_MASK); } LCDOnLPTModule.Wait(LPTLCD.uiDelayBus, multiplier); Output(_lptControl, RS ^ CTRL_MASK); LCDOnLPTModule.Wait(LPTLCD.uiDelayShort, multiplier); //Debug.WriteLine(string.Format("LCD = {0}, Data = {1}", lcd, data)); }
public void WriteControl(LCDSeq lcd, int control, int multiplier) { Output(_lptControl, 0 ^ CTRL_MASK); Output(_lptData, control); LCDOnLPTModule.Wait(LPTLCD.uiDelayBus, multiplier); if (lcd == LCDSeq.LCD1) { Output(_lptControl, E1 ^ CTRL_MASK); } else { Output(_lptControl, E2 ^ CTRL_MASK); } LCDOnLPTModule.Wait(LPTLCD.uiDelayBus, multiplier); Output(_lptControl, 0 ^ CTRL_MASK); LCDOnLPTModule.Wait(LPTLCD.uiDelayShort, multiplier); //Debug.WriteLine(string.Format("LCD = {0}, Command = {1}", lcd, control)); }
public override void Initialize() { Device.WriteControl(Seq, 0x38, Multiplier); LCDOnLPTModule.Wait(uiDelayInit, Multiplier); Device.WriteControl(Seq, 0x38, Multiplier); LCDOnLPTModule.Wait(uiDelayMed, Multiplier); Device.WriteControl(Seq, 0x38, Multiplier); LCDOnLPTModule.Wait(uiDelayShort, Multiplier); Device.WriteControl(Seq, 0x38, Multiplier); LCDOnLPTModule.Wait(uiDelayShort, Multiplier); // display off Device.WriteControl(Seq, 8, Multiplier); LCDOnLPTModule.Wait(uiDelayShort, Multiplier); // display clear Device.WriteControl(Seq, 1, Multiplier); LCDOnLPTModule.Wait(uiDelayLong, Multiplier); // entry set Device.WriteControl(Seq, 6, Multiplier); LCDOnLPTModule.Wait(uiDelayMed, Multiplier); // koniec inicjalizacji // display on, cursor off, blink off Device.WriteControl(Seq, 12, Multiplier); LCDOnLPTModule.Wait(uiDelayLong, Multiplier); // cursor home Device.WriteControl(Seq, 2, Multiplier); LCDOnLPTModule.Wait(uiDelayLong, Multiplier); // utworzenie tablicy przechowującej znaki na wyświetlaczu _characters = new char[Rows][]; for (int i = 0; i < Rows; i++) { _characters[i] = new char[Columns]; } }