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

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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_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(38400);
  21. //long unsigned debug_start = millis ();
  22. //while (!Serial && ((millis () - debug_start) <= 5000)) ;
  23. Serial.println("RA8875 start");
  24. tft.begin(RA8875_800x480);
  25. }
  26. void loop()
  27. {
  28. tft.clearScreen(RA8875_BLUE);
  29. tft.writePattern(100, 100, _pattern16x16, 16, false); //this write a pattern 16x16 at 100,100
  30. tft.BTE_move(100, 100, 16, 16, 200, 200, 1, 1, true, 0xC5);
  31. delay(1000);
  32. tft.clearScreen(RA8875_BLUE);
  33. tft.writePattern(200, 200, _pattern16x16, 16, false);
  34. tft.BTE_move(200, 200, 16, 16, 300, 300, 1, 1, true, 0xC4);
  35. delay(1000);
  36. }