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

Repetitive pattern on GLCD
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Feb 24, 2017 7:20 am     Reply with quote

One way to get it 'up and running' is to eliminate ALL the font tables except for ONE. I don't know how many there are but each must be fairly large. By having only ONE font table, it should be possible to get the code working at least to bench test.

Jay
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 04, 2017 6:42 am     Reply with quote

Do you guys have any idea on how to modify the attached code in order to only clear a specific area of the display and not the whole screen? I have tried several times but haven't successfully found a solution.
Code:

void glcd_blank()
{
   int16 n;
   int8 x,y;
    // Reset the internal buffer
    for (n = 1; n <= (SCREEN_WIDTH * SCREEN_HEIGHT / 8) - 1; ++n) {
        glcd_buffer[n] = 0;
    }

    // Clear the actual screen
    for (y = 0; y < 8; y++) {
        glcd_command(GLCD_CMD_SET_PAGE | y);
        // Reset column to 0 (the left side)
        glcd_command(GLCD_CMD_COLUMN_LOWER);
        glcd_command(GLCD_CMD_COLUMN_UPPER);
        // We iterate to 132 as the internal buffer is 65*132, not
        // 64*124.
        for (x = 0; x < 132; x++) {
            glcd_data(0x00);
        }
    }   
}

thanks
jaume
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 04, 2017 6:51 am     Reply with quote

Normally you draw a filled rectangle with a 'clear' fill.

The bulk clear has to work to byte boundaries, so it can't clear a 'generic' area. However provided you are happy to only clear to such boundaries, you'd have to feed it a value to start from in each direction (would replace the '0' in the counters), and a place to end in each direction (would replace the 'SCREEN_WIDTH', and 'SCREEN_HEIGHT' values). Will be a lot bulkier code though (because the calculations can't then be done by the compiler).
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 04, 2017 6:57 am     Reply with quote

Without having that GLCD here to experiment with, I'd say your code is really two sections.
The first appears to clear the internal GLCD's RAM 'buffer', the second clears the actual display(what you see).

I would suggest that the datasheet for that GLCD has the 'layout' of the actual pixels, probably starting at the upper left as 0,0---lower right as c,r where c is the max column and r is the max row.
To erase (clear) a 'section' of screen you need to know the coordinates of the four corners, then simply clear each pixel within those boundaries, by having two counters (xpos, ypos) that increment between the 'four corners' and reset the pixel (clear).
I'm sure there's a lot of info on the web about your GLCD. If you get really stuck, consult the MS QuickBASIC 4.5 book. They have a whole chapter devoted to 'graphics'. I know BASIC, but the underlying principles of set/reset - on/off ,x,y - r,c are applicable.

Without your GLCD I can't cut/compile/test code.

Jay
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Tue Mar 07, 2017 11:32 am     Reply with quote

The problem is that with this "blank display" code that I have shared doesn't allow to blank neither the display not the buffer in random square locations of the display, as it isn't meant for that, and I don't know how to ie., clean the display in a square that isn't near the x=0 and y=0 location.
thanks
jaume
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 07, 2017 2:44 pm     Reply with quote

Honestly you have to read the GLCD datasheet. What you're asking for must be there, as it's a basic function of the GLCD to turn a pixel on or off. Cutting code(aka driver fucntion) is mearly an implementation of the basic GLCD functions.
Since I don't have that GLCD, I can't try any code that I suggest 'should' work.

However as I pointed out is it possible to 'select' and are bounded by x0,y0-x1y1 and 'erase' all the pixels inside.

Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 07, 2017 11:48 pm     Reply with quote

Just use a text search engine on the files in the CCS drivers directory on
your PC. Search for 'rectangle'. You will find a few functions that
draw a filled rectangle with the specified color.
Here is the glcd_rect() function in graphics.c:
Quote:

//// glcd_rect(x1, y1, x2, y2, fill, color)
////
//// * Draws a rectangle with one corner at point (x1,y1) and
//// the other corner at point (x2,y2)
//// - fill can be YES or NO
//// - color can be ON or OFF
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Tue Mar 21, 2017 8:25 am     Reply with quote

PCM programmer wrote:
Just use a text search engine on the files in the CCS drivers directory on
your PC. Search for 'rectangle'. You will find a few functions that
draw a filled rectangle with the specified color.
Here is the glcd_rect() function in graphics.c:
Quote:

//// glcd_rect(x1, y1, x2, y2, fill, color)
////
//// * Draws a rectangle with one corner at point (x1,y1) and
//// the other corner at point (x2,y2)
//// - fill can be YES or NO
//// - color can be ON or OFF

I have checked the driver files in my computer and i haven't been able to find the rectangle functions you mentioned. Could someone attach some here or tell me where I can download them?

thanks
jaume
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 21, 2017 11:18 am     Reply with quote

graphics.c is in the drivers folder as someone else already said. No one here can give it to you(against policy) but simply contact CCS with your compiler type/version/serinal number and they will send you the file.

Jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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