0
Offline
Newbie
Karma: 0
Posts: 37
Arduino rocks
|
 |
« on: March 09, 2008, 07:06:02 pm » |
alright gang can it be done, i have my doubts that its possible, has anyone tried it? and are there any alternatives?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 40
I love YaBB 1G - SP1!
|
 |
« Reply #1 on: March 09, 2008, 07:36:24 pm » |
yes it can be done: it's probably a 4-wire resistive touch screen. I would check out the TSC2004 from Texus Instrument: it uses TWI interface so you should be able to use the arduino TWI library. Touchscreen chips usually come surface mount so you'll need to get some breakout boards from sparkfun. Read this pdf: http://www.circuitcellar.com/library/print/0100/dahlin-114/dahlin114.pdfit'll have most of the info. you need to get started.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 207
Arduino rocks
|
 |
« Reply #2 on: March 12, 2008, 06:29:08 am » |
jimmeh,
nima's link is a good one - however, you may be able to drive the touch screen from the Arduino itself.
It'll take 4 pins - 2 digital outs and 2 analog ins.
Simply, you apply 0V and 5V to one axis and read a touch value from the other. Then do the other axis.
I did this with a PIC a few years back.
Regards,
Mike
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 37
Arduino rocks
|
 |
« Reply #3 on: March 12, 2008, 07:01:00 am » |
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 207
Arduino rocks
|
 |
« Reply #4 on: March 12, 2008, 10:09:10 am » |
It looks like it would be an analogue resistive type of touch screen - there appear to be 4 connections and two of them lead to lines that go up each side. I guess the others lead to lines across the top. They will handle 5V without trouble. Here is a wikipedia article for a quick intro on how they work: http://en.wikipedia.org/wiki/Analog_resistive_touchscreenand this one gives more info: http://en.wikipedia.org/wiki/Touchscreens#ResistiveIt would be worth reading through the spec sheet of the chip nima mentioned to find out how they do it - then implement it in code in the Arduino (or just use the chip). They seem to be reasonably priced in that auction. FWIW, I have purchased from that seller recently without problem  Regards, Mike
|
|
|
|
« Last Edit: March 12, 2008, 10:16:41 am by BigMike »
|
Logged
|
|
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 37
Arduino rocks
|
 |
« Reply #6 on: March 18, 2008, 12:54:42 pm » |
got it working! after some very fiddly soldering! cheers gang, i just plugged it straight into the arduino, works pretty well.
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2339
Do it !
|
 |
« Reply #7 on: March 18, 2008, 02:33:39 pm » |
I just realized that i have an old defect PDA (Compaq Ipaq) lyíng around. I couldn't resist it when i saw it in the electronics dumpster at the local recycling station a few month back. Lo and behold a nice big 4 wire touchscreen on top of the display.
So let me se if i get this right. i apply 5V and ground to two of the 4 wires and the others are hooked up to analog inputs on the Arduino board an treated just like any other variable resistor ? each giving me a number for the X and Y position on the screen ?
Is there a standard for the 4 wires, can i somehow meassure which is which ?
Is it really that easy ? (except for what looks lige a nightmarish soldering session)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 37
Arduino rocks
|
 |
« Reply #8 on: March 18, 2008, 03:55:43 pm » |
really is that easy!
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2339
Do it !
|
 |
« Reply #9 on: March 18, 2008, 04:06:03 pm » |
Super, that opens up for a series of new projects to pile on top of the others :-)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 207
Arduino rocks
|
 |
« Reply #10 on: March 19, 2008, 07:30:14 am » |
So let me se if i get this right. i apply 5V and ground to two of the 4 wires and the others are hooked up to analog inputs on the Arduino board an treated just like any other variable resistor ? each giving me a number for the X and Y position on the screen ? You have to apply the 5V across one pair then read the analogue value from one of the wires in the other pair, then apply the 5V to the other pair and read the analogue voltage from one of the wires in the first pair. It is that easy, though in a commercial environment you would have to calibrate the x and y values so top left and bottom right etc are accurate, also to prevent build up from electrolysis you would reverse the voltage on the pairs, you would debounce the touches, you would have a sleep mode with touch detection, some filtering of the values is desireable and if you are using it as an input device to replace a mouse, you need to be able to detect a "click". None of this is necessary in simple applications, though. Regards, Mike
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 207
Arduino rocks
|
 |
« Reply #11 on: March 19, 2008, 07:37:29 am » |
got it working! after some very fiddly soldering! cheers gang, i just plugged it straight into the arduino, works pretty well. That's good news, Jim. I was so tempted to get one of those screens, but I have enough projects in line for these Arduinos as it is. Do you have a project in mind for it? Mike
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2339
Do it !
|
 |
« Reply #12 on: March 19, 2008, 10:59:07 am » |
Could you post your code Jimmeh ?
Thanx
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 37
Arduino rocks
|
 |
« Reply #13 on: March 19, 2008, 12:23:03 pm » |
its all delt with in max, just like a potentiometer have it coming into the serial. im basically going to make a kaoss pad, im also getting trying to get this encoder working with it so i can select what changes.
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2339
Do it !
|
 |
« Reply #14 on: March 20, 2008, 05:06:03 am » |
But you do have Arduino read the touch screen right, i don't quite understand how to read the pair. Are they hooked up like two pots constantly ? like one pot and then anoter pot ? i hope this question makes sense.
A little drawing and a few lines of the Arduino code actually doing the analog read would be greatly apreciated.
Thanx
|
|
|
|
|
Logged
|
|
|
|
|
|