Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 18th February 2009, 05:36 PM   #61
Default

wow...
thanks a lot dear jason it work very nice
really you are professional.
Electronic2050 is offline  
Old 18th February 2009, 05:40 PM   #62
Default

na lol i wish i was. I would be making money lol. This is for fun and you are very welcome.
AtomSoft is offline  
Old 25th February 2009, 08:46 AM   #63
Default

Hi,

I made the change so that I can write in black on a white background, it works very well with the function "PutMessage", but why can't i view my logo when i do "PutLogo", whereas before making the change I got to do what I wanted. I wish that my logo is black on a white background..

I think it would be nice to add some features like draw a circle, or add another size of font.
I would also perform a function that clears a defined area, a function like: ClearScreenZone (x1, y1, x2, y2).
Thank you in advance
jorg1n is offline  
Old 25th February 2009, 09:33 AM   #64
Default

I watched the "PutLogo" and it involves the "plot", so I presume it must change (reverse) data as you do in the function "putchar", but it does not work correctly. ..
I inpression that the data are inverted, but they are not sent correctly.
Here is the update:

Code:
void plot(unsigned char x,unsigned char y){
unsigned char d;
	if(x>63){
		b_GLCD_GCS1=1;
		b_GLCD_GCS2=0;
		x-=64;
	}
	else
	{
		b_GLCD_GCS1=0;
		b_GLCD_GCS2=1;
	}
	GLCD_Write_Cmd(0x40+x);			//write column address
	GLCD_Write_Cmd(0xb8+(y>>3));	//write row address
	d=GLCD_Read_Data();				//dummy read
	d=GLCD_Read_Data();
	d=~d;                                            /////ADD
	GLCD_Write_Cmd(0x40+x);			//write column address again
	d=d&(0xff-(1<<(y&7)));
	GLCD_Write_Data(d);
}
Can you help me please..
Thanks in advance
jorg1n is offline  
Old 25th February 2009, 01:59 PM   #65
Default

i just started on the GLCD clock again. I thought since i had gained so much knowledge ill finish my first clock then continue. The pics below are all the clocks i have made and the last would be GLCD one but im still developing the menu for setting the time/date/alarm.

The first one is the best TIME shower. I can see the time across the room at night when im sleepy and it doesn't disturb the eyes. The middle is my desk clock for now until the glcd is done.
Attached Thumbnails
Unicorn GLCD demo.-rev1.jpg   Unicorn GLCD demo.-rev2.jpg   Unicorn GLCD demo.-rev3.jpg  
AtomSoft is offline  
Old 26th February 2009, 12:24 AM   #66
Default

I am using almost the same code and it functions properly for me. My plot function has this line different:

Yours
Code:
        d=d&(0xff-(1<<(y&7)));
Mine
Code:
        if(color)d=d|(1<<(y&7));
	else d=d&(0xff-(1<<(y&7)));
Also, here is a function to draw a circle:
Code:
void bhsmcircle(int xc,int yc,int r)
{
	int x=0,y=r,dp;
	dp=1-r;
	for(;x<y;x++)
	{
		if(dp<0)
		{
			dp+=2*x+3;
		}
		else
		{
			dp+=2*(x-y)+5;
			y--;
		}
		plot(x+xc,y+yc,1);
		plot(-x+xc,-y+yc,1);
	        plot(x+xc,-y+yc,1);
		plot(-x+xc,y+yc,1);
		plot(y+xc,x+yc,1);
		plot(-y+xc,-x+yc,1);
		plot(-y+xc,x+yc,1);
		plot(y+xc,-x+yc,1);
	}
}
EDIT: Be aware that the circle will look more like an ellipse due the rectangular shape of the pixels on the GLCD.

Last edited by superbrew; 26th February 2009 at 12:26 AM.
superbrew is offline  
Old 26th February 2009, 07:50 AM   #67
Default

Hi,

Thank you for your help.
But according to your function "bhsmcircle",you call the function "plot", but there is 3 arguments: "plot(x+xc,y+yc,1)", the "1" corresponds to the variable "color"?

Should we add the argument "color" has all the functions?
Thank you again
jorg1n is offline  
Old 26th February 2009, 08:59 AM   #68
Default

I want to do a function for Clear a zone of the glcd as :
ClearScreenZone (x1, y1, x2, y2)
But I can not ...
Can you help me if you like ...
Thank you in advance
jorg1n is offline  
Old 26th February 2009, 09:49 AM   #69
Default

Try,
Code:
void ClearScreenZone(char x1,char y1,char x2,char y2){
char i,j;
    for(i=y1;i<y2;i++){
        for(j=x1;j<x2;j++)
            unplot(i,j);
    }
}
Mike.
Pommie is offline  
Old 26th February 2009, 10:03 AM   #70
Default

Thank you,

But i don't have function "unplot"...
I think to do :
Code:
void ClearScreenZone(unsigned char x1,unsigned char y1,unsigned char x2,unsigned char y2){
unsigned char m,n;
		for(m=y1;m<y2;m++)
			{
			for(n=x1;n<x2;n++)
				{
				if(n>63){
					b_GLCD_GCS1=1;
					b_GLCD_GCS2=0;
					n-=64;
					}
				else
					{
					b_GLCD_GCS1=0;
					b_GLCD_GCS2=1;
					}
				GLCD_Write_Cmd(0x40+n);			//write column address
				GLCD_Write_Cmd(0xb8+(m>>3));	//write row address
				GLCD_Write_Data(0x00);
				}

			}
}
But it is not yet available
jorg1n is offline  
Old 26th February 2009, 10:46 AM   #71
Default

It's good ... I succeeded, I created a "unplot" identical to "plot" and I replaced:
Code:
     d=d|(1<<(y&7));
by:
Code:
d=d&(0xff-(1<<(y&7)));
Thanks a lot...
jorg1n is offline  
Old 26th February 2009, 02:31 PM   #72
Default

Sorry, I forget that my plot function has a color argument added. Well, all my functions that draw something have a color argument added. That is why my plot function is different than yours.
superbrew is offline  
Old 26th February 2009, 03:18 PM   #73
Default

Hi SuperBrew,

can you send me your file glcd.c because I too would like the opportunity to choose the color.
And i have another question, how do you display a variable of type float or int, for do a voltmeter, for example.
Thank you in advance

Last edited by jorg1n; 26th February 2009 at 03:23 PM.
jorg1n is offline  
Old 3rd March 2009, 11:04 AM   #74
Default

Hi,


I have a problem when I want to write a message, I have a string of characters that is nothing ... and that since I added my functions "unplot", "circle" and "fillzone" ...
I post therefore my glcd.c file, could you help me ..

PS: "superbrew", can you send me your your glcd.c which also functions as setting the color of writing?

Thanks in advance
Attached Files
File Type: c GLCD.c (9.4 KB, 35 views)
jorg1n is offline  
Old 3rd March 2009, 01:00 PM   #75
Default

Sorry this took so long. It is a work in progress, so it may be a little messy.
Attached Files
File Type: c GLCD.c (12.3 KB, 51 views)
superbrew is offline  
Reply

Tags
demo, glcd, unicorn

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Unicorn Oscilloscope running GLCD 128x64 & Photo blueroomelectronics Micro Controllers 8 18th June 2007 03:06 PM
Help understanding the Unicorn Kyle-s4h Micro Controllers 2 5th June 2007 07:09 PM
Open MultiSim DEMO Files mayo General Electronics Chat 1 3rd May 2007 04:52 PM
mcuStudio an Eclipse based IDE for PIC: flash demo available octal Micro Controllers 0 23rd August 2006 06:44 AM
Honeywell HMR3000 DEMO KIT shermaine General Electronics Chat 5 26th May 2005 09:35 AM



All times are GMT. The time now is 09:21 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker