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.

52 lines
1.1KB

  1. /*
  2. Turn display ON/OFF - this command it's almost unusable since it doesn't control the backligh
  3. It result in a white screen!
  4. */
  5. #include <SPI.h>
  6. #include <Adafruit_GFX.h>
  7. #include <TFT_ILI9163C.h>
  8. // Color definitions
  9. #define BLACK 0x0000
  10. #define BLUE 0x001F
  11. #define RED 0xF800
  12. #define GREEN 0x07E0
  13. #define CYAN 0x07FF
  14. #define MAGENTA 0xF81F
  15. #define YELLOW 0xFFE0
  16. #define WHITE 0xFFFF
  17. /*
  18. Teensy3.x and Arduino's
  19. You are using 4 wire SPI here, so:
  20. MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
  21. MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
  22. SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
  23. the rest of pin below:
  24. */
  25. #define __CS 10
  26. #define __DC 9
  27. /*
  28. Teensy 3.x can use: 2,6,9,10,15,20,21,22,23
  29. Arduino's 8 bit: any
  30. DUE: check arduino site
  31. If you do not use reset, tie it to +3V3
  32. */
  33. TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC);
  34. void setup() {
  35. tft.begin();
  36. tft.fillScreen(0xF81F);
  37. }
  38. void loop(void) {
  39. tft.display(false);
  40. delay(1000);
  41. tft.display(true);
  42. delay(1000);
  43. }