View previous topic :: View next topic |
Author |
Message |
noyz
Joined: 31 Jan 2009 Posts: 59
|
Read LCD layout |
Posted: Sat May 28, 2011 12:42 am |
|
|
It is possible to ask yourself what color is this pixel ?
does someone have an example of a function like
Code: |
boolean pixel(int x,int y);
pixel(1,4)= true if pixel is black, false if pixel is white ..
|
this would be really great :D |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Sat May 28, 2011 5:41 am |
|
|
yes, possible.
depends on the LCD how you can do it. Read the LCD datasheet chapter about 'reading the LCD data'.Somewhere it should be documented.Very simple test,did it about 25 years ago on the original laptop(Pset,Pclr,Ptst)....sigh,where does the time go? |
|
|
noyz
Joined: 31 Jan 2009 Posts: 59
|
|
Posted: Sat May 28, 2011 8:14 am |
|
|
It's about ra6963, i found something about Read.. but i don't know exactly how to involve it :-?? |
|
|
noyz
Joined: 31 Jan 2009 Posts: 59
|
|
Posted: Sat May 28, 2011 9:28 am |
|
|
I use the glcd_library
and i tried this with no result.
The int returned by the glcd_readbyte() is 0 always.
Code: |
lcd_gotoxy(1,1,wTEXT);
lcd_putConstStr("c");
lcd_gotoxy(1,1,wTEXT);
cd=glcd_ReadByte();
lcd_gotoxy(1,2,wTEXT);
lcd_putConstStr("_");
lcd_gotoxy(1,3,wTEXT);
lcd_nr(show,cd);
|
Last edited by noyz on Wed Jun 01, 2011 4:30 am; edited 1 time in total |
|
|
noyz
Joined: 31 Jan 2009 Posts: 59
|
|
Posted: Sat May 28, 2011 3:49 pm |
|
|
Can someone please look into this, or maybe had tried something like this and has an example.
I did funny thing, a boolean matrix of lcd x and y which takes like 80 % of PICs RAM and beside that, even if I init it with false, on all values, it seems that it has true values and a lot of them, it shows like block structures:-? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Sun May 29, 2011 6:47 am |
|
|
hmm..does the display actually work correctly for you ? proper characters, graphics where they should be ??
Perhaps your 'read LCD data algorithm is wrong. Force some known data in it's place and then test the function.
Maybe 'google' the LCD model for more info.
I'd cut down the code to just 'text' mode and debug from there. Once 'text' mode works, then add the 'graphics' functions. You've got a lot of code to try to sort out, keep it simple, build upon known working code. |
|
|
noyz
Joined: 31 Jan 2009 Posts: 59
|
|
Posted: Wed Jun 01, 2011 4:33 am |
|
|
The LCD does display proper information, no alteration of code.
The thing i didn't try is that i think when i write something and use
gotoxy
and then
read data
Maybe i have to put gotoxy before or / after the thing i want to read, because maybe it reads the next X:-?
Like when writing something it will be written at x,y and the second character will be auto increment x and will be at x+1,y. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Wed Jun 01, 2011 5:22 am |
|
|
'normally' auto increment is set (turned on) and is part of the LCD 'setup' configuration (cursor on/off, blinking cursor, # of lines, font size, etc.)
Easiest option for you is to print the data, then set x=x-1, or y=y-1 to read the pixel information. |
|
|
|