A SERVICE OF

logo

iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 81
InitLCD(); /* initial LCD */
LcdSetCursorOn(); /* Display cursor */
while(!quit)
{
chr=Getch();
if(y==9) { /*LCD line(y)<=8*/
ClrScrn(); y=1;
}
if(chr=='q') quit=1; /*if input ‘q’, quit the program*/
else if(chr<0x80) Print("%c",chr); /*print input letter*/
Print("[%d]",chr); /*print ASCII code*/
if (j==10) j=0; /*count input to make sure 0<=j<10*/
data[j]=(char)chr;
Print(" %c @LCD(%d,%d) [%d]\r\n",data[j],x,y,j+1); //print (x,y) LCD location
j=j+1;
if (chr==8) { // backspace control
x=x-1;
TextOutAt(x, y, (char *)&chr); //print one space back on LCD
x=x-1;
}
else
TextOutAt(x, y, (char *)&chr); //print on LCD
x=x+1;
if(x==17) { //LCD wide(x)<=16
x=1; //print to first spot of next line
y=y+1;
}
} //end of while loop
CloseLCD();
}