tahir4awan
Full Member level 4
Hi guys I wrote this code to draw a simple vertical line. The problem is the line starts from center but I want line to be started from leftmost side.The GLCD is divided into two parts LEFT and RIGHT but in line command it is only started in right side.Can you help me solving this problem
----------------------------------------------------------------------------
char GLCD_DataPort at PORTD;
sbit GLCD_CS1 at RB0_bit;
sbit GLCD_CS2 at RB1_bit;
sbit GLCD_RS at RB2_bit;
sbit GLCD_RW at RB3_bit;
sbit GLCD_EN at RB4_bit;
sbit GLCD_RST at RB5_bit;
sbit GLCD_CS1_Direction at TRISB0_bit;
sbit GLCD_CS2_Direction at TRISB1_bit;
sbit GLCD_RS_Direction at TRISB2_bit;
sbit GLCD_RW_Direction at TRISB3_bit;
sbit GLCD_EN_Direction at TRISB4_bit;
sbit GLCD_RST_Direction at TRISB5_bit;
void main() {
ANSEL = 0;
ANSELH = 0;
C1ON_bit = 0;
C2ON_bit = 0;
Glcd_Init();
Glcd_Fill(0x00);
while(1) {
Glcd_Fill(0x00);
Glcd_V_Line(0, 60, 0, 1);
delay_ms(2000);
}
}
----------------------------------------------------------------------------
----------------------------------------------------------------------------
char GLCD_DataPort at PORTD;
sbit GLCD_CS1 at RB0_bit;
sbit GLCD_CS2 at RB1_bit;
sbit GLCD_RS at RB2_bit;
sbit GLCD_RW at RB3_bit;
sbit GLCD_EN at RB4_bit;
sbit GLCD_RST at RB5_bit;
sbit GLCD_CS1_Direction at TRISB0_bit;
sbit GLCD_CS2_Direction at TRISB1_bit;
sbit GLCD_RS_Direction at TRISB2_bit;
sbit GLCD_RW_Direction at TRISB3_bit;
sbit GLCD_EN_Direction at TRISB4_bit;
sbit GLCD_RST_Direction at TRISB5_bit;
void main() {
ANSEL = 0;
ANSELH = 0;
C1ON_bit = 0;
C2ON_bit = 0;
Glcd_Init();
Glcd_Fill(0x00);
while(1) {
Glcd_Fill(0x00);
Glcd_V_Line(0, 60, 0, 1);
delay_ms(2000);
}
}
----------------------------------------------------------------------------