| ??? 10/31/06 09:55 Read: times |
#127170 - scrolling can be done as... Responding to: ???'s previous message |
Hi,
Dincer Aydin said: This can be achieved by looping over the menu array so that every time a scroll is required print eight entries by moving forward/backwards in the array. For example print entries 0-7,1-8,2-9,3-10 and so on... As Dincer said, using the below subroutine the scrolling, by one line can be achieved.
void program(int scroll)
{
int m=0,n=8,line;
lcd_writecommand(SET_RAM_0);
screen=1;
state=0;
while(state==0) //till state=0,menu can be viewed using scroll up/down keys
{
lcd_clrscr(); //clear the LCD Screen
lcd_gotoxy(0,0);
for(i=m+scroll;i<n+scroll;i++)
{
line=i;
if(line>=16)
{
line=line-16;
}
else if(line<0)
{
line=line+16;
}
lcd(&string[line][j]);
lcd_putc('\n');
}
enter_key=key_display(1);
switch(enter_key)
{
case 10:scroll--;
break;
case 12:scroll++;
break;
}
}
return;
}
Here, I’m calling lcd_clrscr(); for clearing the screen before updating, as the strings are of varying size. So,changing the complete screen can be viewed clearly between scroll keys.what could be done instead of lcd_clrscr(); thank you very much for your help. regards, veena. |
| Topic | Author | Date |
| scrolling graphic LCD using matrix keypad | 01/01/70 00:00 | |
| Use array of strings | 01/01/70 00:00 | |
| Maybe try something different | 01/01/70 00:00 | |
| scrolling function.... | 01/01/70 00:00 | |
| Table | 01/01/70 00:00 | |
| XDATA? | 01/01/70 00:00 | |
| the reason is... | 01/01/70 00:00 | |
| scrolling display using key... | 01/01/70 00:00 | |
| How do you want to scroll? | 01/01/70 00:00 | |
| Do as Michael said? | 01/01/70 00:00 | |
| "display start line command" is not the way | 01/01/70 00:00 | |
| Why not? | 01/01/70 00:00 | |
| Re: Why not? | 01/01/70 00:00 | |
| scrolling can be done as... | 01/01/70 00:00 | |
| Re: scrolling can be done as... | 01/01/70 00:00 | |
| I wonder | 01/01/70 00:00 | |
| Scrolling | 01/01/70 00:00 | |
ah | 01/01/70 00:00 |



