Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Unicorn GLCD demo.

Status
Not open for further replies.
Please Pommie can you convert my logo to use in GLCD...thanks

Try this,
Code:
const rom unsigned char Logo[]={
    35,58,
    0x20,0x01,0x00,0x00,
    0xA0,0x03,0x00,0x20,
    0x01,0x00,0x00,0x00,
    0x08,0x10,0x00,0x00,
    0x00,0x00,0x00,0x00,
    0x90,0x00,0x08,0x01,
    0x00,0x00,0x00,0x00,
    0x00,0x21,0x00,0x40,
    0x00,0x16,0x00,0x08,
    0x09,0x20,0x12,0x00,
    0xF2,0x80,0x10,0x00,
    0x80,0x08,0x89,0x04,
    0x08,0xBC,0x54,0x00,
    0x40,0x40,0x12,0x02,
    0x00,0x30,0x0A,0x08,
    0x09,0x10,0x00,0x1C,
    0x02,0x80,0xB4,0x45,
    0x3E,0x00,0x04,0x00,
    0x01,0x10,0x40,0x00,
    0x18,0x00,0x80,0x8E,
    0x02,0x66,0x0B,0xD4,
    0x00,0x84,0xAC,0xA0,
    0x0D,0x08,0xAC,0x85,
    0x6B,0x00,0x60,0x2D,
    0xF0,0x04,0x00,0xAB,
    0x63,0x14,0x00,0x58,
    0x0F,0xB5,0x01,0xC0,
    0x9A,0xC1,0x08,0x00,
    0xD6,0xCB,0x3A,0x00,
    0xB0,0x02,0x6A,0x02,
    0x80,0x95,0xD2,0x13,
    0x00,0xB2,0x04,0x77,
    0x00,0x60,0x24,0x44,
    0x03,0x80,0x1A,0xC1,
    0x23,0x00,0xD2,0x08,
    0x23,0x02,0xC0,0x49,
    0xD0,0x2A,0x80,0x59,
    0x02,0x49,0x03,0xE8,
    0x12,0x38,0xF7,0x5A,
    0x8F,0x40,0x5A,0xAD,
    0x3B,0x04,0x4A,0x00,
    0x26,0xA4,0x90,0x47,
    0x50,0x87,0x84,0x02,
    0x22,0xD1,0x03,0xE4,
    0x49,0xD5,0x19,0xA0,
    0xA2,0x08,0xF2,0x00,
    0x2D,0xA7,0x64,0x01,
    0x48,0x96,0x5A,0x1C,
    0x40,0x73,0x45,0xB2,
    0x00,0x75,0xCE,0x68,
    0x02,0x70,0x8C,0x68,
    0x29,0x00,0x10,0x2B,
    0xB4,0x00,0x60,0x9A,
    0x7E,0x01,0x00,0x96,
    0x56,0x0E,0x00,0x98,
    0x43,0x0F,0x00,0x40,
    0x13,0x84,0x01,0x90,
    0x4A,0xD0,0x36,0x00,
    0x00,0x48,0x00,0x00,
    0x98,0x01,0x4C,0x51,
    0x60,0x4D,0x80,0x2A,
    0x05,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,
    0x00,0x00
};

As I said the code I wrote is a bit clunky and so I may have made a mistake. Let us know if it works.

Mike.
 
Hello,

I want to display a "int". I have used the function of SuperBrew (displayNUM)
Code:
void displayNum(int x, int y, int theValue) {
    char toPrint[4];
    
    toPrint[0] = (theValue/1000)+48;
    toPrint[1] = ((theValue%1000)/100)+48;
    toPrint[2] = ((theValue%100)/10)+48;
    toPrint[3] = (theValue%10)+48;
    
    SetPos(x,y);
    PutChar(toPrint[0]);
    PutChar(toPrint[1]);
    PutChar(toPrint[2]);
    PutChar(toPrint[3]);
}


I use it like this:
Code:
int BacklightType;
[...]
BacklightType++;
[...]
displayNum(50,40, BacklightType);

but I get this when I try to display "10" (see photo)
I guess I have "0010" but my character does nothing ...

I also post my glcd.c so you can see my function "putchar". But I find the strange outcome ...
Have you any idea?

Thank you in advance
 

Attachments

  • 000_0323.jpg
    000_0323.jpg
    1.2 MB · Views: 468
  • GLCD.c
    21 KB · Views: 475
Hello,

I return to you because I managed to correct my error display (declaration problem of my variables), but I would now like to add a function to write in large letters .. But I can not find a solution ..
I thank you in advance
 
Hello AtomSoft,

I already create a new policy of width 8 and height 13, but I don't know how to use this. I want to make a function "putchar" to display the font. Could you help me? Will you or may already be a policy of this kind with a function call?
Thank you in advance

I have another problem, I use the function to display a "INT" of SuperBrew, but sometimes it displays symbols like my previous photo! and sometimes it works, would you also an idea about this problem?

Thank you in advance AtomSoft
 
Hy,
I'm stuck, I still can not display a large print, or "float" with the function of Pommie:
Code:
void ftoa(float f,char* String,char Places){
long power;
char n,i;
    power=1;
    while(power*10<=f)
        power*=10;
    while(power>=1){
        n=(char)(f/power);
        f-=n*power;
        power/=10;
        *String++=n+'0';
    }
    *String++='.';
    for(i=0;i<Places;i++){
        f*=10;
        n=(char)f;
        f-=n;
        *String++=n+'0';
    }
    *String=0;
}

How to use this function to convert a float into a string and display it with the GLCD library?


And my second problem, I tried to understand how the display using the putchar function to create my display large font (I need to display from 0 to 9 and the dot ".".
Could you help me, because I'm stuck for a few days, and your support since the beginning helped me a lot, and I hope that this will continue..

Thank You
 
Hi,

I encounter a problem:
I can not write where I want on the axis "y", I still lag 8.i only write on the lines 0, 8, 16, ... even if I do:
Code:
SetPos(50,7); 
PutChar('R');
he writes to the line 0.

Is it possible to solve this problem?
Thank you in advance
 
Hi,

I have a little problem (yes another!), concerning to display a float ..
this is what I do:

Code:
# include <ftoa.h>
...
float voltage;
DataToLcd char [30];
...
voltage = 30.2359;
ftoa (voltage, DataToLcd, 2);

and after that, I have my "char" DataToLcd which is "30.23" is:
DataToLcd [0] ='3 '
DataToLcd [1] ='0 '
DataToLcd [2] = ''.
DataToLcd [3] ='2 '
DataToLcd [4] ='3 '
DataToLcd [5] = ''.
...
DataToLcd [29] = ''.

but then how to display it:
I do fine:

Putchar (DataToLcd);
PutMessage (DataToLcd);

it does not work!

you have an idea?

Thank you in advance
 
Something like,
Code:
    i=0;
    while(DataToLcd[i]!=0)
        PutChar(DataToLcd[i++]);

Mike.
 
Pommie thank you ... it works very well ...
Will you have an idea on my previous post on the writing area on the screen. By the coordinate "y" must always be a multiple of 8? can we change this?
Thank you again
 
It is possible to write characters to any position on the screen. The way to do it is to load each vertical byte of the character into a 16 bit variable and scroll it the required number if pixel (0-6). You then inclusive or this with the screen to draw the character.

Mike.
 
Hi Pommie,

can you tell me what level of the library I need to change something in order to write where I want?

I can not..

Thank you in advance
 
Hi,
I looked again the principle of transmission, and features in the documentation of my display, and I think the solution lies in this function and in the last line:
Code:
void WritePosition(void){
	if(XPos>63){
		b_GLCD_GCS1=1;
		b_GLCD_GCS2=0;
	}
	else{
		b_GLCD_GCS1=0;
		b_GLCD_GCS2=1;
	}
	GLCD_Write_Cmd(0x40+(XPos&0x3f));	//column=0
	GLCD_Write_Cmd(0xb8+((YPos&0x3f)>>3));	//row=0		//row=0	
}

But I can not change it correctly to write to all the lines ...

Can you help me please
Thanks a lot
 
The routine that needs rewriting is the PutChar routine. Unfortunately, the changes required are extensive and I don't have the time to help.

You could write a slower version that looked at each byte of the char and used the plot routine to draw it.

Mike.
 
Hi,

Pommie, have you received my MP?
can you answer my message MP, even if the answer is no?
Thank you in advance.

PS: attached documentation of my display, as on page 12, I looked at the controls and I find it odd that in the WritePosition, when we want to set the value of Y using the direction of X and vice versa.

Thank you again
 

Attachments

  • WG12864C-TFH-V#N.pdf
    403.7 KB · Views: 614
Hi,

For display on all "y" axes, I dropped (I failed ...), I do otherwise.

For against, I'm still stuck on the display of a larger police, are what you could help me please.

Thank you in advance
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top