PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

49 líneas
1.2KB

  1. /*
  2. Simple test of BTE block move
  3. */
  4. #include <SPI.h>
  5. #include <RA8875.h>
  6. /*
  7. Teensy3.x
  8. You are using 4 wire SPI here, so:
  9. MOSI: 11//Teensy3.x
  10. MISO: 12//Teensy3.x
  11. SCK: 13//Teensy3.x
  12. the rest of pin below:
  13. */
  14. #define RA8875_CS 10 //any digital pin
  15. #define RA8875_RESET 9//any pin or 255 to disable it!
  16. RA8875 tft = RA8875(RA8875_CS,RA8875_RESET);
  17. void setup()
  18. {
  19. Serial.begin(38400);
  20. long unsigned debug_start = millis ();
  21. while (!Serial && ((millis () - debug_start) <= 400)) ;
  22. Serial.println("RA8875 start");
  23. // begin display: Choose from: RA8875_480x272, RA8875_800x480, RA8875_800x480ALT, Adafruit_480x272, Adafruit_800x480
  24. tft.begin(RA8875_800x480);
  25. //tft.setRotation(0);
  26. //fill a gradient, so we can test BTEing stuff around the screen
  27. for(int i=0;i<tft.height();i++) tft.drawLine(0,i,tft.width()-1,i,tft.Color565(map(i,0,tft.height(),128,40), map(i,0,tft.height(),255,40), map(i,0,tft.height(),40,128)));
  28. tft.setTextColor(RA8875_PINK,RA8875_BLUE);
  29. tft.setCursor(30,30);
  30. tft.print("HELLO WORLD!");
  31. //The transparent-move option uses the foreground colour as the transparent colour.
  32. tft.setTextColor(RA8875_BLUE);
  33. tft.BTE_move(20,20,30,30,200,200,0,0,true);
  34. }
  35. void loop()
  36. {
  37. }