Forum Rule: Always post complete source code & details to reproduce any issue!
Page 12 of 12 FirstFirst ... 2 10 11 12
Results 276 to 284 of 284

Thread: RA8875 from Buydisplay

  1. #276
    Senior Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    121
    Mike, Kurt,

    That did the job many thanks!
    Was made for a small screen so some work to do for the RA8875 display.

    Take care,
    Best,
    Johan
    Click image for larger version. 

Name:	DeepinScreenshot_select-area_20200319200952.jpg 
Views:	31 
Size:	56.2 KB 
ID:	19415

  2. #277
    Hey Guys,

    I might have missed it, but are we able to choose one of the secondary busses on the T4.x boards? If so is there a reference to how to?

  3. #278
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,494
    Quote Originally Posted by Dylpickle View Post
    Hey Guys,

    I might have missed it, but are we able to choose one of the secondary busses on the T4.x boards? If so is there a reference to how to?
    If I remember correctly we put the code in place to detect it, by which pin numbers you pass in. That is the constructor has:
    Code:
    		RA8875(const uint8_t CSp,const uint8_t RSTp=255,const uint8_t mosi_pin=11,const uint8_t sclk_pin=13,const uint8_t miso_pin=12);
    Yep when we were adding the code for T4.x we made it all use the SPI table driven functions to figure out which SPI buss to use. That is the code in the begin function does:
    Code:
    		//always uses SPI transaction 
    		if (SPI.pinIsMISO(_miso) && SPI.pinIsMOSI(_mosi) && SPI.pinIsSCK(_sclk)) {
    			_pspi = &SPI;
    		} else if (SPI1.pinIsMISO(_miso) && SPI1.pinIsMOSI(_mosi) && SPI1.pinIsSCK(_sclk)) {
    			_pspi = &SPI1;
    		} else if (SPI2.pinIsMISO(_miso) && SPI2.pinIsMOSI(_mosi) && SPI2.pinIsSCK(_sclk)) {
    			_pspi = &SPI2;
    		} else {
    			_errorCode |= (1 << 1);//set
    			return;
    		}
    		// Make sure we select the right pins.  
    		// On T4 does nothing, and on T4.1 only miso matters, but just in case.
    		_pspi->setMISO(_miso);
    		_pspi->setMOSI(_mosi);
    		_pspi->setSCK(_sclk);
    So again just pass in valid pins for MOSI, MISO and SCK and it will do the right thing

  4. #279
    Thanks Mate, I'm looking at buying one but wanted to make sure I have conflicts on other busses.

  5. #280
    Hi KurtE
    You help me couple times and I thank you.
    Please help me with this problem. I have a RA8875 + T4, and I want to display clock with Michroma font, I have this problem, please see the pictures
    Click image for larger version. 

Name:	IMG_1850.jpg 
Views:	5 
Size:	91.5 KB 
ID:	23286
    Click image for larger version. 

Name:	IMG_1852.jpg 
Views:	5 
Size:	82.8 KB 
ID:	23287
    This is part of me code

    tft.setTextColor(RA8875_WHITE, RA8875_BLACK);
    tft.setCursor(345, 10);

    if (hh < 10){
    tft.print("0");
    xpos += pix;
    }

    tft.print(hh);
    xpos += pix;

    tft.print(":");
    xpos += pix;

    if (mm < 10){
    tft.print("0");
    xpos += pix;
    }

    tft.print(mm);
    xpos += pix;

    tft.print(":");
    xpos += pix;

    if (sss < 10){
    tft.print("0");
    xpos += pix;
    }

    tft.print(sss);

    Please tell me some solution to fix this.
    Thank you in advance

  6. #281
    Member KD0RC's Avatar
    Join Date
    May 2019
    Location
    Colorado, USA
    Posts
    75
    I think the problem you are having is that new characters just overlay what is already on the screen. Here is a typical thing that I do to clear the portion of the screen in preparation for new characters:

    Code:
        tft.fillRect(0, 290, 110, 20, HX8357_BLACK);  // Blank slate for new value
        tft.setFont(Arial_14);
        tft.setTextColor(HX8357_YELLOW);
        tft.setCursor(0,290);
        tft.print("RF Pwr: "); tft.print(fRig.transmit.rfpower);
    I make the rectangle of black (or whatever the background color is) so that it just covers the characters to be erased. To make it easy to see what the rectangle will do, I often do a tft.drawRect with a color of white. After adjusting the x and y coordinates, I change it to fillRect with a color of black.

  7. #282
    Thank you
    In this case, I have to move the rectangle and change the weight, I was hopping there is better way to fix this, like using layers or some kind of "active window"
    to put the clock inside.

  8. #283
    Member KD0RC's Avatar
    Join Date
    May 2019
    Location
    Colorado, USA
    Posts
    75
    The problem with my method is that rapidly changing values can induce flicker. Another approach is to save the current value of each character or characters to be updated. At update time, rewrite the old value in background color, then write the new value. If the characters have variable width, this can be problematic, so you have to re-write everything to the right of the character being changed. For character sets with the same width for all characters, this is no problem - just rewrite the changing char.

  9. #284
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,494
    Sorry I really don't know the RA887x that well to know how all of the different fonts work or not. I believe this is NOT a system font so we are simply drawing the bits.
    Again I also mostly just putter and don't do any real products. (Retired)...

    But with my own stuff what I have often done with logical fields like this is something like: Warning, I am doing sort of valid stuff, but may not be fully correct (typing on fly not studying headers)

    a) simple approach: If I know that my text is supposed to be in some rectangle field:
    I do something like:
    Code:
      tft.setTextColor(fgColor, bgColor
      tft.setCursor(fieldX, FieldY)'
      tft.drawText(newtime);
      int16_t xcursor = tft.getCursorX();
      tft.fillRect(xCursor, fieldY, (fieldX_end - xcursor), field_height);
    So you fill everything to the right of your current text in the field with background color

    b) slightly smarter like above, but instead of filling whole field to right. you remember how far to the right the previous write went and only if your new right is < previous right, you
    fill from current right to last previous right...

Posting Permissions

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