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:
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: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);
So again just pass in valid pins for MOSI, MISO and SCK and it will do the right thingCode://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);
Thanks Mate, I'm looking at buying one but wanted to make sure I have conflicts on other busses.
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
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
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:
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.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);
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.
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.
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:
So you fill everything to the right of your current text in the field with background colorCode: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);
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...