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.

67 lines
1.7KB

  1. /*
  2. Basic Scroll example
  3. Works with Arduino 1.0.6 IDE, Arduino 1.6.x IDE
  4. */
  5. #include <SPI.h>
  6. #include <RA8875.h>
  7. #define RA8875_CS 10
  8. #define RA8875_RESET 9//any pin or nothing!
  9. RA8875 tft = RA8875(RA8875_CS, RA8875_RESET);
  10. void setup()
  11. {
  12. Serial.begin(9600);
  13. //while (!Serial) {;}
  14. Serial.println("RA8875 start");
  15. //initialization routine
  16. tft.begin(RA8875_800x480);
  17. //tft.setRotation(1);
  18. tft.println("Once upon a midnight dreary, while I pondered, weak and weary,");
  19. tft.println("Over many a quaint and curious volume of forgotten lore,");
  20. tft.println("While I nodded, nearly napping, suddenly there came a tapping,");
  21. tft.println("As of some one gently rapping, rapping at my chamber door.");
  22. tft.println("'Tis some visitor,' I muttered, 'tapping at my chamber door Only this, and nothing more.'");
  23. tft.println("");
  24. tft.println("Ah, distinctly I remember it was in the bleak December,");
  25. tft.println("And each separate dying ember wrought its ghost upon the floor.");
  26. tft.println("Eagerly I wished the morrow;- vainly I had sought to borrow");
  27. tft.println("From my books surcease of sorrow- sorrow for the lost Lenore-");
  28. tft.println("For the rare and radiant maiden whom the angels name Lenore-");
  29. tft.println("Nameless here for evermore.");
  30. }
  31. void loop()
  32. {
  33. tft.setScrollWindow(0, tft.width() - 1, 0, 80); //Specifies scrolling activity area
  34. uint16_t i;
  35. for (i = 0; i < 80; i++) {
  36. tft.scroll(0, i);
  37. delay(10);
  38. }
  39. delay(500);
  40. for (i = 79; i > 0; i--) {
  41. tft.scroll(0, i);
  42. delay(10);
  43. }
  44. delay(500);
  45. for (i = 0; i < tft.width(); i++) {
  46. tft.scroll(i, 0);
  47. delay(5);
  48. }
  49. delay(500);
  50. for (i = tft.width() - 1; i > 0; i--) {
  51. tft.scroll(i, 0);
  52. delay(5);
  53. }
  54. delay(500);
  55. }