Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "SPI.h"
  2. #include "TFT_22_ILI9225.h"
  3.  
  4. #define TFT_RST A4
  5. #define TFT_RS  A3
  6. #define TFT_CS  A5  // SS
  7. #define TFT_SDI A2  // MOSI
  8. #define TFT_CLK A1  // SCK
  9. #define TFT_LED 0   // 0 if wired to +5V directly
  10.  
  11. // Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
  12. //TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED);
  13. // Use software SPI (slower)
  14. TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED);
  15.  
  16. const unsigned char gImage_ic[3872] PROGMEM= { /* 0X00,0X01,0XB0,0X00,0XB0,0X00, */// Setup
  17. void setup() {
  18.   tft.begin();
  19.   Serial.begin(9600);
  20. }
  21.  
  22. // Loop
  23. void loop() {
  24.   startTime = millis();
  25.   tft.drawBitmap(0, 0, gImage_ic, 176, 176, COLOR_CYAN);
  26.   tft.setBackgroundColor(COLOR_BLACK);
  27.   tft.setFont(Terminal6x8);
  28.   tft.drawText(0, 178, "Printing some random text.", COLOR_WHITE);
  29.   tft.drawText(0, 188, "Another line of nonsense", COLOR_WHITE);
  30.   duration = String(millis()-startTime);
  31.   tft.drawText(0, 198, duration, COLOR_WHITE);
  32.  
  33.  
  34.  
  35.   while(true);
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement