Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
unsigned [COLOR="Red"]rom[/COLOR] char ww;
unsigned char XPos,YPos, ww;
unsigned char i;
unsigned char XPos,YPos;
[COLOR="red"]unsigned far rom char dat[/COLOR];
unsigned char GLCD_Read(void){
b_GLCD_E=1;
Delay();
[COLOR="red"]dat[/COLOR]=GLCD_Data; [COLOR="red"]//dat will never get written to[/COLOR]
b_GLCD_E=0;
Delay();
return [COLOR="red"]dat[/COLOR];
}
unsigned char GLCD_Read(void){
unsigned char localdat;
b_GLCD_E=1;
Delay();
localdat=GLCD_Data; //dat will never get written to
b_GLCD_E=0;
//Delay(); not needed
return localdat;
}
unsigned char GLCD_Read(void){
b_GLCD_E=1;
Delay();
ww=GLCD_Data;
b_GLCD_E=0;
return ww;
}
void Test(){
char ret,i;
for(i=0;i<8;i++){
SetPos(0,0);
GLCD_Write_Data(1<<i);
ret=GLCD_Read_Data();
if(ret!=(1<<i))
while(1);
}
while(1);
}
void main(void)
{
char ret,i;
// disable AD converter and set up Port A as digital I/O
ADCON0bits.ADON = 0;
ADCON1 = 0b00001111;
Init_GLCD();
for(i=0;i<8;i++){
SetPos(0,0);
GLCD_Write_Data(1<<i);
ret=GLCD_Read_Data();
if(ret!=(1<<i))
while(1);
}
while(1);
}
GLCD_Write_Data(0x0D);
ret=GLCD_Read_Data();
if(ret!=0x0D)
//ERROR: INPUT DOESNT MATCH OUTPUT
else
//Data OK!
#define GLCD_Data (LATC)
#define b_GLCD_GCS1 (LATBbits.LATB1)
#define b_GLCD_GCS2 (LATBbits.LATB2)
#define b_GLCD_RS (LATBbits.LATB3)
#define b_GLCD_RW (LATBbits.LATB4)
#define b_GLCD_E (LATBbits.LATB5)
#define b_GLCD_On (LATBbits.LATB6) // not available on my GLCD
#define b_GLCD_BL (LATBbits.LATB7)
// Define the direction for each Input/Output pin (0-Output, 1-Input) :
#define TRIS_Data (TRISC)
#define b_TRIS_GCS1 (TRISBbits.TRISB1)
#define b_TRIS_GCS2 (TRISBbits.TRISB2)
#define b_TRIS_RS (TRISBbits.TRISB3)
#define b_TRIS_RW (TRISBbits.TRISB4)
#define b_TRIS_E (TRISBbits.TRISB5)
#define b_TRIS_On (TRISBbits.TRISB6) // not available on my GLCD
#define b_TRIS_BL (TRISBbits.TRISB7)
#define LED1 (LATAbits.LATA0)
#define LED2 (LATAbits.LATA1)