예제 #1
0
파일: Lcd.cs 프로젝트: josemotta/Netduino
        /// <summary>
        /// Sets cursor move direction and specifies display shift. These operations are
        /// performed during data write and read.
        /// </summary>
        /// <param name="displayShift">Enable or disable display shifting</param>
        /// <param name="cursorDirection">Cursor move direction</param>
        public void EntryModeSet(DisplayShift displayShift, CursorDirection cursorDirection)
        {
            //  DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
            //  0   0   0   0   0   1   I/D S

            byte entryModeCmd = ENTRY_MODE_SET;

            // if requested display shifting
            if (displayShift == DisplayShift.Yes)
            {
                entryModeCmd |= DISPLAY_SHIFT_ENABLE;
            }

            // cursor direction if display shifting enabled
            if (cursorDirection == CursorDirection.Increment)
            {
                entryModeCmd |= CURSOR_DIRECTION_INCREMENT;
            }

            this.SendCommand(entryModeCmd); // 37 us (datasheet)
        }
예제 #2
0
파일: Lcd.cs 프로젝트: ppatierno/uplibrary
        /// <summary>
        /// Sets cursor move direction and specifies display shift. These operations are
        /// performed during data write and read.
        /// </summary>
        /// <param name="displayShift">Enable or disable display shifting</param>
        /// <param name="cursorDirection">Cursor move direction</param>
        public void EntryModeSet(DisplayShift displayShift, CursorDirection cursorDirection)
        {
            //  DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
            //  0   0   0   0   0   1   I/D S

            byte entryModeCmd = ENTRY_MODE_SET;

            // if requested display shifting
            if (displayShift == DisplayShift.Yes)
                entryModeCmd |= DISPLAY_SHIFT_ENABLE;

            // cursor direction if display shifting enabled
            if (cursorDirection == CursorDirection.Increment)
                entryModeCmd |= CURSOR_DIRECTION_INCREMENT;

            this.SendCommand(entryModeCmd); // 37 us (datasheet)
        }