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.

sleep.ino 1.3KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. Sleep Command example
  3. Very simple, when sleep on DC/DC converter is stopped, Internal oscillator is stopped, and panel scanning is stopped
  4. MCU interface and memory are still working and the memory keeps its contents.
  5. NOTE:
  6. The led background still active since it's NOT controlled by chip so the result it's a white screen until you turn off
  7. the backlight!
  8. */
  9. #include <SPI.h>
  10. #include <Adafruit_GFX.h>
  11. #include <TFT_ILI9163C.h>
  12. // Color definitions
  13. #define BLACK 0x0000
  14. #define BLUE 0x001F
  15. #define RED 0xF800
  16. #define GREEN 0x07E0
  17. #define CYAN 0x07FF
  18. #define MAGENTA 0xF81F
  19. #define YELLOW 0xFFE0
  20. #define WHITE 0xFFFF
  21. /*
  22. Teensy3.x and Arduino's
  23. You are using 4 wire SPI here, so:
  24. MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
  25. MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
  26. SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
  27. the rest of pin below:
  28. */
  29. #define __CS 10
  30. #define __DC 9
  31. /*
  32. Teensy 3.x can use: 2,6,9,10,15,20,21,22,23
  33. Arduino's 8 bit: any
  34. DUE: check arduino site
  35. If you do not use reset, tie it to +3V3
  36. */
  37. TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC);
  38. void setup() {
  39. tft.begin();
  40. tft.fillScreen(0xF800);
  41. delay(500);
  42. }
  43. void loop(void) {
  44. tft.sleepMode(true);
  45. delay(1000);
  46. tft.sleepMode(false);
  47. delay(1000);
  48. }