ayus, nabuo ko rin sa wakas ang function para gumawa ng vertical line,
given given 2 points (y1 & y2) lying on the same column x.
void lcd_vertical_line (char x, char y1, char y2)
{
char i, temp, line1, line2, data;
if( (x>83) || (y1>47) || (y2>47) ) return; //exit if out of range
if(y1>y2)
{
temp = y1;
y1 = y2; //swap variables
y2 = temp;
}
line1 = y1>>3; //divide by 8
line2 = y2>>3;
for(i=line1; i<=line2; i++)
{
data = 0xff;
lcd_gotoxy(x,i);
if(i==line1)
{
data = 0;
temp = 8 - (y1 % 8);
while(temp--) data |= (0x80>>temp);
}
if(i==line2)
{
temp = 7 - (y2 % 8);
while(temp--) data &= ~(0x80>>temp);
}
lcd_send(data, LCD_TDATA);
}
}*magagamit ito sa "oscilloscope" project pang-interpolate ng dalawang points(i.e. "connect the dots")
two other useful functions:
void erase_column(char x)
{
char line;
if(x>83) return;
for(line=0; line<6; line++)
{
lcd_gotoxy(x, line);
lcd_send(0x00, LCD_TDATA);
}
}
void lcd_pixel (char x, char y)
{
char data;
if ((x > 83) || (y > 47)) return;
data = 0x01<<(y%8);
lcd_gotoxy(x, (y>>3));
lcd_send(data, LCD_TDATA);
}