Don't know how to work with touch screen...
hi.
i using arduino mega 2560 utft screen(touch screen included) - http://www.ebay.com/itm/3-2-tft-lcd-shield-touch-panel-tf-reader-for-arduino-/270972145966?pt=lh_defaultdomain_0&hash=item3f1732d12e
also i'm using library init utft screen , touch screen : http://www.uctronics.com/download/arduino_shileds/3inch2_revb.zip
the question : how can if rectangle touched?
i using arduino mega 2560 utft screen(touch screen included) - http://www.ebay.com/itm/3-2-tft-lcd-shield-touch-panel-tf-reader-for-arduino-/270972145966?pt=lh_defaultdomain_0&hash=item3f1732d12e
also i'm using library init utft screen , touch screen : http://www.uctronics.com/download/arduino_shileds/3inch2_revb.zip
the question : how can if rectangle touched?
code: [select]
#include <utft.h>
#include <itdb02_touch.h>
#include <sd.h>
// declare fonts using
extern uint8_t smallfont[];
extern uint8_t bigfont[];
utft screen(itdb32s,a1,a2,a0,a3);
itdb02_touch tscreen(13,10,11,12,9);
boolean welcome = true;
void setup() {
screen.initlcd(portrait);
screen.clrscr();
screen.setfont(bigfont);
tscreen.inittouch();
tscreen.setprecision(prec_low);
}
void loop() {
if (welcome) {
screen.setcolor(255,0,0);
screen.fillrect( 20,20,60,60); //how can if rect touched?
}
}
i have not programmed touch screens, can you. (i have programmed lot of small games pcs)
everytime when wanted object clicked , mouse got above comparing actual position of mouse x , y. think applies touchscreen. try compare position of touched finger position of rectangle (x , y ofc)
everytime when wanted object clicked , mouse got above comparing actual position of mouse x , y. think applies touchscreen. try compare position of touched finger position of rectangle (x , y ofc)
Arduino Forum > Using Arduino > Displays > Don't know how to work with touch screen...
arduino
Comments
Post a Comment