RA8875 library

Status
Not open for further replies.
Triangles are created by RA8875 hardware accellerated macro and has several bugs, I already noticed in some 3d examples where I've used polygon triangulations and mainly in filled triangles.
I've already tried to fix the filled triangle bugs, it appears when 2 vertices are close and the result it's a gigantic rectangle, or in this case it create a nonsense object.
For get pixel I guess has something to do with screen resolution, the RA8875 works best with 480x272 because it maps the memory banks internally as separate pages but when used with higher resolutions it doesn't have enough memory so it uses strange mapping methods and (if you are using layers) change it color depth at 8bit but internally try to expand colors in 16 to save internal RAM. Many functions are affected, try to scale a uploaded font char will cause a mess and so on.
 
Last edited:
So with the last bit of code, tft.fillTriangle(393,41, 400,40, 20,94, RA8875_WHITE);, do you see vertical lines too or some corruption? And if you test the random code I posted earlier, do you also see corruption? I want to make sure it's not just me and my setup and wire length that's causing corruption.

I'm using a breadboard with jumper wires and I know I can get some corruption at times when I move my wires around. So just making sure this isn't just me.
 
I'm trying to figure out this one. I get screen corruption after I draw any line then a certain sized triangle. I can change a lot of the triangle points to different locations and still get the corruption. But at some point the values end up working okay after being moved a certain amount.

Anyone else get a green vertical bar at the lower-left of the triangle with this code?

Code:
#include <SPI.h>
#include <RA8875.h>

RA8875 tft = RA8875(20, 2, 7, 14, 8);

void setup() {
  tft.begin(RA8875_800x480);

  tft.drawLine(50,50, 100,50, RA8875_BLUE);
  tft.fillTriangle(480,152, 456,212, 215,410, RA8875_GREEN);
}

void loop() {
}

EDIT: Ok. I figure it's another bug in the RA8875 hardware. I've created a few pull requests and patched the RA8875 triangle vertices bug.
EDIT2: Still testing bug patch code. I think I may need to add a few tenths of a percent to the area calculation. Found a good threshold for the area, 0.9 seems to work okay.
 
Last edited:
Would it be possible to make the _tsAdcMinX,_tsAdcMinY,_tsAdcMaxX,_tsAdcMaxY variables public?

I copied your touch screen calibration method into a function, then save the values generated into the EEPROM. Then on bootup if custom calibration values have been written I set the _tsAdcMinX,_tsAdcMinY,_tsAdcMaxX,_tsAdcMaxY variables with the values pulled from the EEPROM. You also have to reset these values when you set the screen rotation. For this to work though I had to change those variables to public. Is there a better way to accomplish this?

This allows my users to calibrate their touch screen without me having to modify the calibration data everytime. BTW thanks for the hardwork on this library, it made my life much easier
 
Would it be possible to make the _tsAdcMinX,_tsAdcMinY,_tsAdcMaxX,_tsAdcMaxY variables public?

Can you try to move those variables from the private: section up a little bit to the public: section in RA8875.H? Maybe that'll work?
 
Thank you sumotoy for your incredible work. You may open a possibility for me to complete a project.
Being on a project halted for lack of proper means to display a needle (galvanometers are too slow and old technology. Precision is required) I'm wondering if a 5" to 7" display using RA8875 library would do the job of displaying a graphic needle to show variations similar to a VU-meter ? Teensy 3.1 or 3.2 plus external ADC are used in this project. If anyone can let me know if it is possible to display a graphic needle, clean, no jaggies, fast and visually attractive ?
 
If anyone can let me know if it is possible to display a graphic needle, clean, no jaggies, fast and visually attractive ?

You should be able to display a really fast meter with a needle. There's even some examples he setup which use round meters with a needle. 800x480 5" or 7" should be able to draw a nice line without too many jaggies. Of course the closer you get the more you'll see. You could always try a shading trick of dimmer colors right next to the needle to limit the jaggie effect. It can only look as visually attractive as you can program. There's not really too much in the form of end products handed to you on a silver platter, so you'll have to do some graphic programming to suit your needs. But there are plenty of examples for all functions needed. Checking out the ring meter example is a start and you should be able to build upon that.
 
Thank you for your answer MrTom. I'll give it a try then.
As I tested previously the U8glib and UTFT libraries with various displays with some success but really toooooo slow and the only one lib fast enough I tested was the ILI9341_t3 I was wondering if the RA8875 was similar in speed to the ILI9341_t3 library.
 
Thank you for your answer MrTom. I'll give it a try then.
As I tested previously the U8glib and UTFT libraries with various displays with some success but really toooooo slow and the only one lib fast enough I tested was the ILI9341_t3 I was wondering if the RA8875 was similar in speed to the ILI9341_t3 library.

The RA8875 is wicked fast. But it's really the RA8875 chip that's in the TFT display that's fast. It has builtin hardware accelerated functions, like drawing a rectangle, square, or triangle. All you have to transmit to the TFT is just a little bit of code and the display takes care of if at hardware speeds. Sumotoy is doing a great job at building the library from the ground up that communicates to the RA8875 chip. The chip has many bugs and he has to create special code to work around those bugs. He's also creating really fast font code too that should be compatible with many displays.

This is really the only TFT display that I've seen and have experience with, besides a 1.5" OLED display. I'm satisfied with the speed I'm getting on it while drawing lines, circles, squares, & triangles.

I ran a quick test on my 800x480 5" display and I can draw about 6150 random sized same color lines a second on the screen, and about 5340 random sized and random colored lines a second.
I can draw about 1650 random sized same color filled rectangles, and about 1600 random sized and random colored filled rectangles a second.
 
So perhaps a stupid question, but wouldn't it make sense to communicate from a Teensy to a Raspberry Pi 3 and just send data having the Raspbery Pi 3 display it over HDMI to a real high resolution 5/7 inch screen?
 
So perhaps a stupid question, but wouldn't it make sense to communicate from a Teensy to a Raspberry Pi 3 and just send data having the Raspbery Pi 3 display it over HDMI to a real high resolution 5/7 inch screen?

That would be awesome. I'm still hoping someone will create something along these lines for the pi zero (something like an open source and highly capable version of what companies like Nextion or 4G Systems are doing) - if the availability ever gets reasonable the price is hard to beat! But something like that would be a different animal entirely from what's being done here with the RA8875. I'm no expert, but it seems this is our best option right now as hobbyists looking to interact with large screens. I'm using a 7" display from Buy Display on my current project with Sumotoy's library. There are definitely limitations and oddities with the RA8875 itself, but on the whole thanks to the work that's been put into the library, it's incredibly usable and fast.
 
@Sumotoy,

I'm using the newest Teensy 3.5 which is a 5.0v board as you probably know...so choosing between the BuyDisplay 5" and 7" screens, I would have to go with the 7" screen because its 5v right? The 5" 3.3v screen would not work on a 5v Teensy 3.5 board, right?
 
Teensy 3.5 is not a 5v board. All of its digital output pins are still 3.3v. It's simply 5v-tolerant for digital input (but not necessarily other pins)
 
BuDisplay is only talking about powering the board when they differentiate between 5V and 3.3V. Get whichever is more convenient to power. The signal levels are 3.3V for all. There is an issue on the RA8875 wiki and issue list about the 5v not being option for the 5" because of a missing regulator, but I don't believe this is a general concern. I've gotten a 5V 5" screen since then and it does have the regulator and works fine.
 
I've the 5" LCD from buydisplay. I'm trying to use the aerial_22 and aerial_48 font but they don't look quite right. I'm expecting a bit more of an Arial font.

Does aerial_22 and aerial_48 meant to look like this ?

IMG_0810.jpg

void setup()
{

tft.begin(RA8875_800x480);

tft.setFont(&aerial_22);
tft.setCursor(0, 100);
tft.print("aerial_22 ABCDEFG abcdefg 0123456");

tft.setFont(&aerial_48);
tft.setCursor(0, 150);
tft.print("aerial_44 ABCDEFG abcdefg 0123456");
}

I was hoping to get Arial like this:
ArialBlack_Impact.jpg
 
Last edited:
Those are probably the normal RA8875 fonts. It's a hardware-based design without the more complex software used in the ILI9341_t3 library.
 
I know this is a partially old thread, and I might get chastised for bumping it, but I am ready!

That being said, Are there plans to add support for the expanded constructors for the 3.5 and 3.6?

Should I add them and toss in a merge/pull request?
 
Status
Not open for further replies.
Back
Top