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 904B

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. tft.begin(RA8875_800x480);
  18. for (int i = 0; i < tft.width(); i++) {
  19. tft.drawFastVLine(i, 0, 110, tft.colorInterpolation(RA8875_RED, RA8875_PINK, i, tft.width()));
  20. }
  21. tft.setFont(&akashi_36);
  22. tft.setTextColor(RA8875_WHITE);//background transparent!!!
  23. tft.setCursor(CENTER, 0);
  24. if (tft.width(true) > 400){
  25. tft.setFontScale(2);
  26. } else {
  27. tft.setFontScale(1);
  28. }
  29. tft.println("SUMOTOY");
  30. }
  31. void loop()
  32. {
  33. }