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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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_RESET 9//any pin or nothing!
  9. #if defined(NEEDS_SET_MODULE)//Energia, this case is for stellaris/tiva
  10. RA8875 tft = RA8875(3);//select SPI module 3
  11. /*
  12. for module 3 (stellaris)
  13. SCLK: PD_0
  14. MOSI: PD_3
  15. MISO: PD_2
  16. SS: PD_1
  17. */
  18. #endif
  19. void setup()
  20. {
  21. // Serial.begin(38400);
  22. // long unsigned debug_start = millis ();
  23. // while (!Serial && ((millis () - debug_start) <= 5000)) ;
  24. // Serial.println("RA8875 start");
  25. tft.begin(RA8875_800x480);
  26. for (int i = 0; i < tft.width(); i++) {
  27. tft.drawFastVLine(i, 0, 110, tft.colorInterpolation(RA8875_RED, RA8875_PINK, i, tft.width()));
  28. }
  29. tft.setFont(&akashi_36);
  30. tft.setTextColor(RA8875_WHITE);//background transparent!!!
  31. tft.setCursor(CENTER, 0);
  32. if (tft.width(true) > 400){
  33. tft.setFontScale(2);
  34. } else {
  35. tft.setFontScale(1);
  36. }
  37. tft.println("SUMOTOY");
  38. }
  39. void loop()
  40. {
  41. }