/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
/*
CS (pin3)- 27
RST (pin4) - 26
DC (pin5) - 14
MOSI (pin6) - 23
SCK - (pin7) - 18
MISO (pin9) - 19
T_CLK (pin10) - 18
T_CS (pin11) - 21
T_DIN (pin12) - 23
T_DO (pin13) - 19
T_IRQ (pin14) - 2
read only 34,35.36,39
*/
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include "obrazki.h"
#include "colors.h"
#include "XPT2046_Touchscreen.h"
#include "Fonts/FreeSans12pt7b.h"
// #include "lvgl.h"
// For the Adafruit shield, these are the default.
#define TFT_DC 14
#define TFT_CS 27
#define XPT2046_IRQ 2 // T_IRQ
#define XPT2046_MOSI 23 // T_DIN
#define XPT2046_MISO 19 // T_OUT
#define XPT2046_CLK 18 // T_CLK
#define XPT2046_CS 21 // T_CS
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
SPIClass touchscreenSPI = SPIClass(VSPI);
XPT2046_Touchscreen touchscreen(XPT2046_CS, XPT2046_IRQ);
void setup() {
tft.begin();
touchscreenSPI.begin(XPT2046_CLK, XPT2046_MISO, XPT2046_MOSI, XPT2046_CS);
touchscreen.begin(touchscreenSPI);
// Set the Touchscreen rotation in landscape mode
// Note: in some displays, the touchscreen might be upside down, so you might need to set the rotation to 3: touchscreen.setRotation(3);
touchscreen.setRotation(1);
pinMode(33, OUTPUT);
// tft.setFont(&FreeSans12pt7b);
tft.setRotation(3);
tft.setTextSize(2);
//tft.fillScreen(0x7BEF);
//ft.drawLine(50,50,100,100,0xC618);
tft.setCursor(100, 100);
tft.print("Dupa");
tft.fillRect(100, 150, 100, 100, 0xC618);
tft.drawBitmap(100, 100, epd_bitmap_error2, 128, 128, TFT_RED);
}
void loop() {
}