Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: RA8875_t4 and teensy 4.0 bumping graphics rows down on the display programmatically

  1. #1
    Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    66

    RA8875_t4 and teensy 4.0 bumping graphics rows down on the display programmatically

    I'm still working my way through the RA8875 library .. But I'll ask anyway ... I currently am running an array (100 X 512).. a new line is added to the top of the array and the following rows get pushed down and the last row (row 100) gets dropped off...at this point the array is sent off to the RA8875... and of course everything comes to just short of a screaming halt ( well not really but it really slows up .. Given the choice > I would prefer to just send the new row to the ra8875 and bump the existing rows down on the display to allow for the new line..

    for those that have more experience programming the ra8875, is there a function that will allow me to bump rows down on the RA8874 side of the equation then trying to write a full array to the display...

    oh this is a graphics line that gets shifted not text...

    So "schooling and guidance would be appreciated" .. and if there is a better method I'm all for it .Sort of a novice here...

    Thanks in advance..
    K

  2. #2
    Senior Member Projectitis's Avatar
    Join Date
    Feb 2018
    Location
    New Zealand
    Posts
    174
    I haven't specifically used the RA8875 libraries, but I believe they do support hardware scrolling.
    Just looking at sumotoy's source code, it looks like you would:

    1) Set the area to scroll using
    Code:
    setScrollWindow( left, right, top, bottom );
    2) Scroll by a certain x and y amount using
    Code:
    scroll( x, y );
    3) Draw just your new information to the display

    You likely only need to set your scroll window once at the start (or again only if you need to change the area that needs to scroll).

    There is also a method called
    Code:
    setScrollMode
    which can take values of SIMULTANEOUS, LAYER1ONLY, LAYER2ONLY, BUFFERED, but I have no idea what those might do.

    For example, to move the display down by 20 pixels at a time and leave a 20 pixel gap at the top, I would do something this:

    Code:
    // Assuming your RA8875 instance is called 'display'
    
    // Set the scroll window
    display.setScrollWindow( 0, RA8875_WIDTH-1, 0, RA8875_HEIGHT-20-1 );
    
    // Move down 20 pixels
    display.scroll( 0, 20 );
    
    // Clear the top 20 pixels to black
    display.fillRect( 0, 0, RA8875_WIDTH, 20, 0x0 /*black*/ );
    
    // Now draw your new stuff in the top 20 pixels

  3. #3
    Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    66
    Thank-you very much,! yes ..I'll have a good look at this ...and see what I can do with it .. thank-you for your time ..Ill post up after I see if I can make it happen ..

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,412
    Check forum threads [ here is a start point latest-drivers-and-best-place-to-find-drivers ] - there is an 'aftermarket' update to the sumotoy library that offers updates and perhaps T_4.x specific improve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •