CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

GLCD Problem.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
chalukg



Joined: 12 Dec 2010
Posts: 6
Location: Turkey

View user's profile Send private message AIM Address

GLCD Problem.
PostPosted: Fri Feb 11, 2011 5:06 pm     Reply with quote

Hello dear coders. I have a problem as you read.
I wrote something on GLCD and when I want to rewrite on the same pixel
it overwrites on it. So that I have to clear screen and have to rewrite what I want to write. Is there any solutions for this situation or do I have to keep doing this?
I hope i could explain myself.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Sat Feb 12, 2011 9:43 am     Reply with quote

Hi,

The answer to your question is fundamentally 'yes'. The graphic lcd is nothing more than an array of pixels that you control Off/On. When you overwrite an area on the GLCD with new data, it is imperative that all pixels within that area be 'refreshed' to the new value, if the value for a particular pixel has changed. If you are writing text to the GLCD, all of the pixels associated with displaying a particular character are defined, so you don't have to explicitly refresh an area when updating. That is the way that the glcd_text57 function works in GLCD.c. If I was writing a routine to display a bitmap image or something, I would write it so that each pixel is explicitly controlled.

Hope that helps! If not, maybe you could be more specific about your problem and/or post the problem code!

John
petu65



Joined: 05 Jan 2011
Posts: 8

View user's profile Send private message

PostPosted: Fri Feb 18, 2011 6:41 am     Reply with quote

Modify GLCD.C like this:

Look at "void glcd_text57(int x,....." section almost end of code.

Code:

            if(bit_test(pixelData[j], k)) // Check if the pixel should be set
            {
               for(l=0; l<size; ++l)      // The next two loops change the
               {                          // character's size
                  for(m=0; m<size; ++m)
                  {
                     glcd_pixel(x+m, y+k*size+l, color); // Draws the pixel
                  }
               }
            }
            else
            {
                for(l=0; l<size; ++l)      // The next two loops change the
                {                          // character's size
                   for(m=0; m<size; ++m)
                   {
                      glcd_pixel(x+m, y+k*size+l, OFF); // Draws the pixel
                   }
                }
            }


         }
      }
   }
}



This overwrite all pixels, used and not used ones.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group