PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 3 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_RESET 9//any pin or nothing!
  8. #if defined(NEEDS_SET_MODULE)//Energia, this case is for stellaris/tiva
  9. RA8875 tft = RA8875(3);//select SPI module 3
  10. /*
  11. for module 3 (stellaris)
  12. SCLK: PD_0
  13. MOSI: PD_3
  14. MISO: PD_2
  15. SS: PD_1
  16. */
  17. #endif
  18. void setup()
  19. {
  20. Serial.begin(9600);
  21. //while (!Serial) {;}
  22. Serial.println("RA8875 start");
  23. //initialization routine
  24. tft.begin(RA8875_800x480);
  25. //tft.setRotation(1);
  26. tft.println("Once upon a midnight dreary, while I pondered, weak and weary,");
  27. tft.println("Over many a quaint and curious volume of forgotten lore,");
  28. tft.println("While I nodded, nearly napping, suddenly there came a tapping,");
  29. tft.println("As of some one gently rapping, rapping at my chamber door.");
  30. tft.println("'Tis some visitor,' I muttered, 'tapping at my chamber door Only this, and nothing more.'");
  31. tft.println("");
  32. tft.println("Ah, distinctly I remember it was in the bleak December,");
  33. tft.println("And each separate dying ember wrought its ghost upon the floor.");
  34. tft.println("Eagerly I wished the morrow;- vainly I had sought to borrow");
  35. tft.println("From my books surcease of sorrow- sorrow for the lost Lenore-");
  36. tft.println("For the rare and radiant maiden whom the angels name Lenore-");
  37. tft.println("Nameless here for evermore.");
  38. }
  39. void loop()
  40. {
  41. tft.setScrollWindow(0, tft.width() - 1, 0, 80); //Specifies scrolling activity area
  42. uint16_t i;
  43. for (i = 0; i < 80; i++) {
  44. tft.scroll(0, i);
  45. delay(10);
  46. }
  47. delay(500);
  48. for (i = 79; i > 0; i--) {
  49. tft.scroll(0, i);
  50. delay(10);
  51. }
  52. delay(500);
  53. for (i = 0; i < tft.width(); i++) {
  54. tft.scroll(i, 0);
  55. delay(5);
  56. }
  57. delay(500);
  58. for (i = tft.width() - 1; i > 0; i--) {
  59. tft.scroll(i, 0);
  60. delay(5);
  61. }
  62. delay(500);
  63. }