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 841B

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  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. tft.begin(RA8875_800x480);
  17. }
  18. void loop()
  19. {
  20. tft.clearScreen(RA8875_BLUE);
  21. tft.writePattern(100, 100, _pattern16x16, 16, false); //this write a pattern 16x16 at 100,100
  22. tft.BTE_move(100, 100, 16, 16, 200, 200, 1, 1, true, 0xC5);
  23. delay(1000);
  24. tft.clearScreen(RA8875_BLUE);
  25. tft.writePattern(200, 200, _pattern16x16, 16, false);
  26. tft.BTE_move(200, 200, 16, 16, 300, 300, 1, 1, true, 0xC4);
  27. delay(1000);
  28. }