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.

patternExample.ino 961B

3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. Just a basic example, an hello world example.
  3. */
  4. #include <SPI.h>
  5. #include <RA8875.h>
  6. #include "pattern16x16.h"
  7. #define RA8875_CS 10
  8. #define RA8875_RESET 9//any pin or 255 to disable it!
  9. RA8875 tft = RA8875(RA8875_CS, RA8875_RESET);
  10. void setup()
  11. {
  12. Serial.begin(38400);
  13. //long unsigned debug_start = millis ();
  14. //while (!Serial && ((millis () - debug_start) <= 5000)) ;
  15. Serial.println("RA8875 start");
  16. // begin display: Choose from: RA8875_480x272, RA8875_800x480, RA8875_800x480ALT, Adafruit_480x272, Adafruit_800x480
  17. tft.begin(RA8875_800x480);
  18. }
  19. void loop()
  20. {
  21. tft.clearScreen(RA8875_BLUE);
  22. tft.writePattern(100, 100, _pattern16x16, 16, false); //this write a pattern 16x16 at 100,100
  23. tft.BTE_move(100, 100, 16, 16, 200, 200, 1, 1, true, 0xC5);
  24. delay(1000);
  25. tft.clearScreen(RA8875_BLUE);
  26. tft.writePattern(200, 200, _pattern16x16, 16, false);
  27. tft.BTE_move(200, 200, 16, 16, 300, 300, 1, 1, true, 0xC4);
  28. delay(1000);
  29. }