Touch screen keypad

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have searched for a couple of days now and I either cant find or am not searching with the correct keywords for a touch screen keypad.

could someone post a link to a how to.. or something please.

I have the pad layout on screen but need some pointers specifically on how to handle the input. I know when a button is pressed and know or can set the value accordingly. What I don't know and have a mind blank is how to handle that info!

The figures will be in the up to 500million range of numbers (MHz) for frequency input and scan ranges.

Any help or pointers would be really appreciated.

The onscreen call sign is the originator of the base code (DG6FL) he used push buttons on a 20x4 character LCD.

Thanks
Nigel - G0JKN

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparkfun sell some touch pads. And have (or at least had) links to how to deal with the pad.
It's all in all about 10 lines of C code for the raw read.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks Sparrow, that's the way everyone else is going, an external pad. I want to do it on the screen in the long run its cheaper and I think looks much better.

switches gauges graphs etc. in one convenient package.

I will take a look at the code though it may be useful.

Thanks
Nigel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To implement a touch screen you use one of two technologies. The cheap and cheerful option is a resistive touch screen. This has a sandwich of glass panels placed on top of the LCD. The sandwich contains small plastic beads and the inner surfaces are coated in Indium Tin Oxide. This conducts electricity but has the same refractive index as glass so looks invisible (it's also used in the construction of LCD too). The beads keep two surfaces apart. When you prod with your finger or a platic stylus the two layers connect so a voltage can flow. The resistance (and hence voltage) varies in both X and Y directions so using two ADC channels to read voltage in X and Y tells you where the surface connection has occurred.

The modern kind of touch is capacitive rather than resistive. This is the kind of touch found in ipads, iphones and all decent "multi touch" devices. It's more complex than the simple two ADC resistive and usually there's a dedicated small CPU (often Atmel in fact) that is monitoring the induced charge created by the human operator in a field generated from behind the screen.

Most AVR projects would use resistive and you can buy "sandwich" panels with the same dimensions as most common small graphic LCD panels to go on top. Although the ITO is in theory "invisible" it does tend to attenuate the sharpness and clarity of the LCD.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Clawson,
I do understand how the differing types of touch screen work and have working code I just needed a little direction as to how to capture the button press information and turn it in to a long number... storing each input in a position of an array terminated by clear or enter seems to be the most logical way.

Regards
Nigel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well you have an X ADC value and a Y ADC value. Presumably these can be scaled to a pixel x,y position. If your "buttons" are 20 pixels square in a 4 by 4 grid starting at offset 200,180 and your ADC converts to picel 234, 207 then its 14 pixels across the second button across and seven pixels into the 2nd one down. It's really just a question of intercepting rectangles. Picking an "easy" width/height (like a binary multiple) may simplify the maths.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you need to make a weak pull up so no touch read as max ADC an not moveing around on noise.
Make more space between "keys" in the layout