Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Adafruit_GFX.h> // Core graphics library
- #include <Adafruit_TFTLCD.h> // Hardware-specific library
- #include <TouchScreen.h>
- #define YP A3 // Y+ is on Analog1
- #define XM A2 // X- is on Analog2
- #define YM 9 // Y- is on Digital7
- #define XP 8 // X+ is on Digital6
- #define TS_MINX 150
- #define TS_MINY 120
- #define TS_MAXX 920
- #define TS_MAXY 940
- TouchScreen ts = TouchScreen(XP, YP, XM, YM, 100);
- //Definicao de cores
- #define BLACK 0x0000
- #define BLUE 0x001F
- #define RED 0xF800
- #define GREEN 0x07E0
- #define CYAN 0x07FF
- #define MAGENTA 0xF81F
- #define YELLOW 0xFFE0
- #define WHITE 0xFFFF
- //PP_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
- Adafruit_TFTLCD tft(A3, A2, A1, A0, A4);
- char tecla;
- boolean a = 1;
- int rotacao = 1; //// rotação pode ser 1 ou 3
- int ymenor = 0;
- int ymaior = 0;
- int xmenor = 0;
- int xmaior = 0;
- int control = 0;
- #define MINPRESSURE 10
- #define MAXPRESSURE 1000
- void setup(void)
- {
- Serial.begin(9600);
- tft.reset();
- delay(500);
- tft.begin(0x9341);
- tft.setRotation(rotacao);
- tft.fillScreen(BLACK);
- }
- void loop()
- {
- while (Serial.available())
- {
- tecla = Serial.read();
- control++;
- //tft.drawRoundRect(158, 24, 68, 29, 5, WHITE);///botao girar
- tft.setTextColor(WHITE);
- tft.setTextSize(6);
- tft.setCursor(60+control, 30);
- tft.println(tecla);
- //delay(100);
- }
- control = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement