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.

45 satır
1.3KB

  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/heydings_36.c"//minipixel
  11. #define RA8875_CS 20
  12. #define RA8875_RESET 21//any pin or 255 to disable it!
  13. RA8875 tft = RA8875(RA8875_CS, RA8875_RESET,7,14);
  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. // begin display: Choose from: RA8875_480x272, RA8875_800x480, RA8875_800x480ALT, Adafruit_480x272, Adafruit_800x480
  21. tft.begin(RA8875_800x480);
  22. tft.setRotation(0);//works at any rotation as well
  23. tft.setFont(&heydings_36);
  24. tft.setFontScale(2);
  25. tft.setCursor(0,0);
  26. //tft.setTextColor(RA8875_GREEN);//notice that! After grandient text will be this color!
  27. //grandient it's one shot, text color will be reset as the one choosed by setTextColor
  28. //tft.setTextGrandient(RA8875_RED,RA8875_CYAN);//works also with rendered text!
  29. tft.println("BSuRF");
  30. tft.print("_");
  31. }
  32. void loop()
  33. {
  34. }