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.

fontRendering.ino 1.4KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. This shows the capabilities of the library text engine that is
  3. extremely flexible and simple! All commands are the same for all type of text
  4. (INT,EXT or Render ones) and things like println works too.
  5. You can use all the print() options (like print(var,HEX), etc. Take a look the print command
  6. in the arduino guide!)
  7. */
  8. #include <SPI.h>
  9. #include <RA8875.h>
  10. #include "fonts/akashi_36.c"//minipixel
  11. #define RA8875_CS 10
  12. #define RA8875_RESET 9//any pin or 255 to disable it!
  13. RA8875 tft = RA8875(RA8875_CS, RA8875_RESET);
  14. void setup()
  15. {
  16. // Serial.begin(38400);
  17. // long unsigned debug_start = millis ();
  18. // while (!Serial && ((millis () - debug_start) <= 5000)) ;
  19. // Serial.println("RA8875 start");
  20. tft.begin(RA8875_800x480);
  21. tft.setRotation(0);//works at any rotation as well
  22. tft.setFont(&akashi_36);
  23. tft.setFontScale(3);
  24. tft.setCursor(CENTER,0);
  25. tft.setTextColor(RA8875_GREEN);//notice that! After grandient text will be this color!
  26. //grandient it's one shot, text color will be reset as the one choosed by setTextColor
  27. tft.setTextGrandient(RA8875_RED,RA8875_CYAN);//works also with rendered text!
  28. tft.println("CD 0123");
  29. tft.println("ABCD");//notice that correctly goes in another line
  30. tft.setFont(INT);
  31. tft.setTextColor(RA8875_WHITE);//Force white
  32. tft.println("this is the internal text.");//notice that correctly goes in another line too!
  33. }
  34. void loop()
  35. {
  36. }