ILI9481
Wed Apr 16 2014, 01:58 pm
Hello, I didn't receive any code with the display. Can you post the link from where you downloaded the file or maybe upload the file to one of those file sharing sites and share the link.
Thanks.
Thanks.
Tue May 13 2014, 10:11 pm
Once drove off display I decided to make a counter with buttons. made fon 16x32 figures do not fully visible, some show half and see other purpose. Any ideas why. This is the code
void main_Write_COM( int DH) //öÃà Ã
{
LCD_RS=0;
LCD_CS =0;
LCD_DataPortH=DH>>8;
LCD_DataPortL=DH;
LCD_WR=0;
LCD_WR=1;
LCD_CS =1;
}
void main_Write_DATA(int DH) //éÙ+ù
{
LCD_RS=1;
LCD_CS =0;
LCD_DataPortH=DH>>8;
LCD_DataPortL=DH;
LCD_WR=0;
LCD_WR=1;
LCD_CS =1;
}
void main_W_com_data( int com1,dat1) //öÃà ÃéÙ+ùð¦ôÃ
{
main_Write_COM(com1);
main_Write_DATA(dat1);
}
void LCD_SetPos(unsigned int x1,unsigned int x2,unsigned int y1,unsigned int y2)
{
main_Write_COM(0x002a);
main_Write_DATA(x1>>8); //©Lé+X
main_Write_DATA(x1); //©Lé+X
main_Write_DATA(x2>>8); //+ÀéÜX
main_Write_DATA(x2); //+ÀéÜX
main_Write_COM(0x002b);
main_Write_DATA(y1>>8); //©Lé+Y
main_Write_DATA(y1); //©Lé+Y
main_Write_DATA(y2>>8); //+ÀéÜY
main_Write_DATA(y2); //+ÀéÜY
main_Write_COM(0x002c);
}
#include "16x32.h"
void LCD_PutChar16x32(unsigned int x,unsigned int y,unsigned int c,unsigned int fColor,unsigned int bColor)
{
unsigned int i,j;
LCD_SetPos(x,x+16-1,y,y+32-1);
for(i=0; i<32;i++) {
unsigned int m=Font16x32[c*32+i];
for(j=0;j<16;j++) {
if((m&0x8000)==0x8000) {
Write_Data_U32(fColor);
}
else {
Write_Data_U32(bColor);
}
m<<=1;
}
}
}
void LCD_PutChar(unsigned short x, unsigned short y,unsigned int c, unsigned int fColor, unsigned int bColor) {
LCD_PutChar16x32( x, y, c , fColor, bColor );
}
void my_itoa(unsigned int number) // preobrazuva v chislo samo v tozi sluchai
{
data_ind[5] = '\0';
data_ind[4] = (number%10);
data_ind[3] = '.';
data_ind[2] = ((number%100) - data_ind[4])/10;
data_ind[1] = ((number%1000) - data_ind[2]*10 - data_ind[4])/100;
data_ind[0] = ((number) - data_ind[4] - data_ind[2]*10 - data_ind[1]*100)/1000;
data_ind[4] = data_ind[4] + '0';
data_ind[2] = data_ind[2] + '0';
data_ind[1] = data_ind[1] + '0';
data_ind[0] = data_ind[0] + '0';
}
void izobrazqvane ()
{
my_itoa(CNT2);
LCD_PutString(100,100,data_ind,Black,White);
}
void main_Write_COM( int DH) //öÃà Ã
{
LCD_RS=0;
LCD_CS =0;
LCD_DataPortH=DH>>8;
LCD_DataPortL=DH;
LCD_WR=0;
LCD_WR=1;
LCD_CS =1;
}
void main_Write_DATA(int DH) //éÙ+ù
{
LCD_RS=1;
LCD_CS =0;
LCD_DataPortH=DH>>8;
LCD_DataPortL=DH;
LCD_WR=0;
LCD_WR=1;
LCD_CS =1;
}
void main_W_com_data( int com1,dat1) //öÃà ÃéÙ+ùð¦ôÃ
{
main_Write_COM(com1);
main_Write_DATA(dat1);
}
void LCD_SetPos(unsigned int x1,unsigned int x2,unsigned int y1,unsigned int y2)
{
main_Write_COM(0x002a);
main_Write_DATA(x1>>8); //©Lé+X
main_Write_DATA(x1); //©Lé+X
main_Write_DATA(x2>>8); //+ÀéÜX
main_Write_DATA(x2); //+ÀéÜX
main_Write_COM(0x002b);
main_Write_DATA(y1>>8); //©Lé+Y
main_Write_DATA(y1); //©Lé+Y
main_Write_DATA(y2>>8); //+ÀéÜY
main_Write_DATA(y2); //+ÀéÜY
main_Write_COM(0x002c);
}
#include "16x32.h"
void LCD_PutChar16x32(unsigned int x,unsigned int y,unsigned int c,unsigned int fColor,unsigned int bColor)
{
unsigned int i,j;
LCD_SetPos(x,x+16-1,y,y+32-1);
for(i=0; i<32;i++) {
unsigned int m=Font16x32[c*32+i];
for(j=0;j<16;j++) {
if((m&0x8000)==0x8000) {
Write_Data_U32(fColor);
}
else {
Write_Data_U32(bColor);
}
m<<=1;
}
}
}
void LCD_PutChar(unsigned short x, unsigned short y,unsigned int c, unsigned int fColor, unsigned int bColor) {
LCD_PutChar16x32( x, y, c , fColor, bColor );
}
void my_itoa(unsigned int number) // preobrazuva v chislo samo v tozi sluchai
{
data_ind[5] = '\0';
data_ind[4] = (number%10);
data_ind[3] = '.';
data_ind[2] = ((number%100) - data_ind[4])/10;
data_ind[1] = ((number%1000) - data_ind[2]*10 - data_ind[4])/100;
data_ind[0] = ((number) - data_ind[4] - data_ind[2]*10 - data_ind[1]*100)/1000;
data_ind[4] = data_ind[4] + '0';
data_ind[2] = data_ind[2] + '0';
data_ind[1] = data_ind[1] + '0';
data_ind[0] = data_ind[0] + '0';
}
void izobrazqvane ()
{
my_itoa(CNT2);
LCD_PutString(100,100,data_ind,Black,White);
}
Thu May 15 2014, 10:18 am
An interesting way of writing array. I did not understand what problem you're facing write now and the picture is not clear either. Did you try printing numbers with static input?
e.g.
e.g.
LCD_PutChar(100, 100, '1', Black, White);
Wed May 28 2014, 09:49 am
When I print only 1 number there is not problem.
The problem is solved. I reduced the font to 8x32.
The problem is solved. I reduced the font to 8x32.
Thu May 29 2014, 10:18 am
Thanks for updating. But for bigger fonts if one character is working fine then probably you need to look into function LCD_PutString, where you're passing data to probably putchar function.
also try sending fix string data to "LCD_PutString" and see if it works, if it does then your number to ascii conversion routine is causing an issue.
also try sending fix string data to "LCD_PutString" and see if it works, if it does then your number to ascii conversion routine is causing an issue.
Powered by e107 Forum System