Author Topic: Curspr position  (Read 8022 times)

gtec

  • Guest
Curspr position
« on: March 25, 2005, 10:08:14 am »
I am using a MiniMax board. Does anyone know how to get the CursorSet in lcd.c to work beyond 15. If you write CursorSet( 18 ) for example it sets it to the 3rd character, not the 18th.

I guess this is happening because of the 4-bit addressing mode so it reads it as 2 instead of 18. Anyone know how to fix this????

vitaliy

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Re: Curspr position
« Reply #1 on: March 27, 2005, 02:05:28 am »
/***************************************************************************
; Function:       SetCurrentTextPosition
;
; Description:      sets the cursor position to the <column>
;                        and <row> specified.
;
; Inputs:          UBYTE column
;                        UBYTE row
;
; Returns:         nothing
;**************************************************************************/
void SetCurrentTextPosition(UBYTE column, UBYTE row)
{
     /* Combine address & command */
     if ( row == 1)             column |= 0xC0;      // for bottom line
           else                    column |= 0x80;      // for top line
     /*  Send command to LCD */      
     WriteCtrl(column>>4);                  
     WriteCtrl( column & 0xF);
}

Please try this function

gtec

  • Guest
Re: Cursor position
« Reply #2 on: March 28, 2005, 06:46:17 pm »
Thanks,

This worked well so I cna move on with the project. I was pulling my hair out on this one.

gtec

Thanks for the quick response also.