[Library] LCD Library, goto_ScreenLocation

12 views
Skip to first unread message

orzesz...@gmail.com

unread,
May 27, 2019, 8:34:19 PM5/27/19
to BeagleBoard
I'm using most popular LCD library for beaglebone.

I want to know if anybody repair using of function:
void goto_ScreenLocation(int line, int position,struct gpioID enabled_gpio[])

Couse as the author wrote: "but * it is not doing so for the second line'
I was trying to change the value of position but it doesn't work.

void goto_ScreenLocation(int line, int position,struct gpioID enabled_gpio[])
{
   
int nbr_selectedPins=6;
   
const char *pinDescription[] = {"","","","","",""};
   
unsigned int data_to_write;

   
//printf("position: %d\n",position);
   
//printf("line: %d\n\n",line);
   
//if (line==1) position=position+124;
   
if (line==1) position=position+40;
   
if (line==2) position=position+20;
   
if (line==3) position=position+84;
    data_to_write
=return_address_in_bitform(position,0);
   
//printf("data_to_write: %d\n",data_to_write);
    data_to_write
=bitWrite(data_to_write,1,0);
   
//printf("<%d>\n",data_to_write);
    turn_ON_OFF_pins
(enabled_gpio,data_to_write,nbr_selectedPins,MAX_DELAY,pinDescription);
    pulsePin
(enabled_gpio,data_to_write,nbr_selectedPins,DISPLAY_DATA_ON_SCREEN, pinDescription, 5, MAX_DELAY);
      sleep
(MAX_DELAY);

    data_to_write
=return_address_in_bitform(position,1);
   
//printf("data_to_write: %d\n",data_to_write);
    turn_ON_OFF_pins
(enabled_gpio,data_to_write,nbr_selectedPins,MAX_DELAY,pinDescription);
    pulsePin
(enabled_gpio,data_to_write,nbr_selectedPins,DISPLAY_DATA_ON_SCREEN, pinDescription, 5, MAX_DELAY);
      sleep
(MAX_DELAY);
}


Kotkas

unread,
Jun 3, 2019, 9:02:37 PM6/3/19
to BeagleBoard
From the original function, just change the offset line to be hex 0x40, like this:
if (line==1) position=position+0x40; //40;
Reply all
Reply to author
Forward
0 new messages