PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

68 lines
1.8KB

  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. // begin display: Choose from: RA8875_480x272, RA8875_800x480, RA8875_800x480ALT, Adafruit_480x272, Adafruit_800x480
  17. tft.begin(RA8875_800x480);
  18. //tft.setRotation(1);
  19. tft.println("Once upon a midnight dreary, while I pondered, weak and weary,");
  20. tft.println("Over many a quaint and curious volume of forgotten lore,");
  21. tft.println("While I nodded, nearly napping, suddenly there came a tapping,");
  22. tft.println("As of some one gently rapping, rapping at my chamber door.");
  23. tft.println("'Tis some visitor,' I muttered, 'tapping at my chamber door Only this, and nothing more.'");
  24. tft.println("");
  25. tft.println("Ah, distinctly I remember it was in the bleak December,");
  26. tft.println("And each separate dying ember wrought its ghost upon the floor.");
  27. tft.println("Eagerly I wished the morrow;- vainly I had sought to borrow");
  28. tft.println("From my books surcease of sorrow- sorrow for the lost Lenore-");
  29. tft.println("For the rare and radiant maiden whom the angels name Lenore-");
  30. tft.println("Nameless here for evermore.");
  31. }
  32. void loop()
  33. {
  34. tft.setScrollWindow(0, tft.width() - 1, 0, 80); //Specifies scrolling activity area
  35. uint16_t i;
  36. for (i = 0; i < 80; i++) {
  37. tft.scroll(0, i);
  38. delay(10);
  39. }
  40. delay(500);
  41. for (i = 79; i > 0; i--) {
  42. tft.scroll(0, i);
  43. delay(10);
  44. }
  45. delay(500);
  46. for (i = 0; i < tft.width(); i++) {
  47. tft.scroll(i, 0);
  48. delay(5);
  49. }
  50. delay(500);
  51. for (i = tft.width() - 1; i > 0; i--) {
  52. tft.scroll(i, 0);
  53. delay(5);
  54. }
  55. delay(500);
  56. }