Making use of input from A13-LCD7-TS

Started by mikenycz, March 31, 2014, 06:26:52 PM

Previous topic - Next topic

mikenycz

I have not used a touch screen before in a project. I was wondering if someone can point me to a tutorial on how to read data from the touch screen for use within a C program? What I was wondering specifically, for example, If I place an icon at a location on the screen and someone touches the icon on the screen, how would I detect the touching action? I assume that somewhere the X-Y of the screen touch is output from the screen however I need the details on how I would trap this event and make use of it within a program. Any pointers would be appreciated. Or, if there is a software development tool to develop a touch screen application any pointers to that would work as well.

Thank you,
Mike Nycz

dave-at-axon

Hi Mike,

First question I got to ask.

Are you using an OS for this system you are working on?

If the answer is yes, the OS will take care of the touch and depending on the GUI development, it will create OnClick type events.

If you don't have an OS then you need to keep track of the buttons/images and their position and size. You then handle the touch and work out where it was touched and then scan through each of your buttons or images to find the one that it is within. You then handle the up and down.

If you want to see how this is done, have a look at GHI Electronics website and look for their Glide library for the .NETMF as this has buttons, images, text boxes etc that handle touch input. It might guide you on how this all works.

Best way seeing as you are using an A13 is to just use the OS and let it handle it for you. You then just work on the GUI. :)

mikenycz

Dave,
    Yes, I am using the Debian OS. That being said, are there flags or variables that get set when a touch screen event occurs? Like I said, I have not programmed a mouse or touch screen application before (except in VB which handles all the button type events). I am looking for a tutorial or example where these events would be handled in a C program for instance.

Thank you,
Mike Nycz

MBR

The touch screen, from the aplication poit of view, works almost like a normal mouse, so you can use the same function as you use to work with the mouse. The only difference, AFAIK, is the multitouch, but I'm not sure if the displays support it (some probably do, see http://olimex.wordpress.com/2012/11/30/a13-lcd4-3ts-with-multitouch-feature/ ) at it requires special API anyway (namely XInput 2.2+).