Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 69 of 69

Thread: RA8875 library

  1. #51
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    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 by sumotoy; 02-27-2016 at 03:20 AM.

  2. #52
    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.

  3. #53
    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 by MrTom; 03-07-2016 at 12:43 AM.

  4. #54
    Junior Member
    Join Date
    Mar 2016
    Posts
    11
    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

  5. #55
    Quote Originally Posted by Jason_C View Post
    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?

  6. #56
    Junior Member
    Join Date
    Jan 2015
    Posts
    3
    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 ?

  7. #57
    Quote Originally Posted by cob View Post
    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.

  8. #58
    Junior Member
    Join Date
    Jan 2015
    Posts
    3
    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.

  9. #59
    Junior Member
    Join Date
    Mar 2016
    Posts
    11
    Quote Originally Posted by MrTom View Post
    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?
    Thanks MrTom that does do the trick

  10. #60
    Quote Originally Posted by cob View Post
    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.

  11. #61
    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?

  12. #62
    Quote Originally Posted by SharpEars View Post
    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.

  13. #63
    Senior Member
    Join Date
    Oct 2015
    Posts
    227
    @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?

  14. #64
    Junior Member
    Join Date
    Nov 2016
    Posts
    8
    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)

  15. #65
    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.

  16. #66
    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 ?

    Click image for larger version. 

Name:	IMG_0810.jpg 
Views:	350 
Size:	27.7 KB 
ID:	9300

    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:
    Click image for larger version. 

Name:	ArialBlack_Impact.jpg 
Views:	354 
Size:	215.9 KB 
ID:	9301
    Last edited by skpang; 01-04-2017 at 07:59 PM.

  17. #67
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,681
    Those are probably the normal RA8875 fonts. It's a hardware-based design without the more complex software used in the ILI9341_t3 library.

  18. #68
    Senior Member
    Join Date
    Dec 2016
    Location
    Detroit, Michigan, USA
    Posts
    102
    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?

  19. #69
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,681
    Quote Originally Posted by Detroit_Aristo View Post
    Should I add them and toss in a merge/pull request?
    Yes, please do.

Posting Permissions

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