PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

renderTextExample3.ino 1.0KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Another small example for render text.
  3. This time shows the ability to use transparency.
  4. */
  5. #include <SPI.h>
  6. #include <RA8875.h>
  7. #include "fonts/akashi_36.c"
  8. #define RA8875_CS 10
  9. #define RA8875_RESET 9//any pin or 255 to disable it!
  10. RA8875 tft = RA8875(RA8875_CS, RA8875_RESET);
  11. void setup()
  12. {
  13. // Serial.begin(38400);
  14. // long unsigned debug_start = millis ();
  15. // while (!Serial && ((millis () - debug_start) <= 5000)) ;
  16. // Serial.println("RA8875 start");
  17. // begin display: Choose from: RA8875_480x272, RA8875_800x480, RA8875_800x480ALT, Adafruit_480x272, Adafruit_800x480
  18. tft.begin(RA8875_800x480);
  19. for (int i = 0; i < tft.width(); i++) {
  20. tft.drawFastVLine(i, 0, 110, tft.colorInterpolation(RA8875_RED, RA8875_PINK, i, tft.width()));
  21. }
  22. tft.setFont(&akashi_36);
  23. tft.setTextColor(RA8875_WHITE);//background transparent!!!
  24. tft.setCursor(CENTER, 0);
  25. if (tft.width(true) > 400){
  26. tft.setFontScale(2);
  27. } else {
  28. tft.setFontScale(1);
  29. }
  30. tft.println("SUMOTOY");
  31. }
  32. void loop()
  33. {
  34. }