gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > touch screen calibration for those with passme/passthru

#38477 - Darkain - Mon Mar 28, 2005 9:23 am

I've been working on new touch-screen code. I used the information that is mentioned here and here. I want to make sure that these calculations are correct on more DS units then I have available to me here (2).

http://ds.darkain.com/hack/dsPaint.ds.gba

This is a modified copy of daPaint. Basically, just dump it on your flashcart, run it, and see how well painting works for you. Do you feel that it is fairly accurate? How well does it compare to PictoChat's accuracy?

If we get a common agreance that this is indeed a good algorithm, I would like to have these calculated values added to the IPC along-side the existing raw values for X/Y.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#38529 - josath - Mon Mar 28, 2005 10:58 pm

someone (maybe me) should write a touch screen test, where you just draw to all sides of the touchscreen, and it prints out the minimum & maximum x & y values, then you can just use that to find the formula to convert the raw touch x & y to actual screen x & y positions.

also, would be nice to know, if the touchscreen actually gives you higher resolution information than 256x192, you might be able to use this to draw smoother/more accurate lines in dspaint.

---

here's a really nice drawing program for the Sharp Zaurus PDA (linux & QT based pda w/ an ARM processor).

http://killefiz.de/zaurus/showdetail.php?app=174

It draws nice lines because internally the bitmap you draw on is double the resolution of the screen. The way the 'fill' mode works, instead of filling the selected area instantly, the color slowly spreads out from where you touch the screen, and stops when you let go, which lets you fill shapes that aren't completely closed.

#38545 - Darkain - Tue Mar 29, 2005 12:24 am

just so you know, each touch screen is different. that is the purpose of this current test. im using the stored calibration data within the DS to calculate the X/Y coords. we have already sat there and done the whole min/max thing, and it simply just doesnt work consistantly.

this demo DOES print the x/y coords on the top screen (post calculation coords), as well as allow for drawing anywhere on the screen (yes, you can even draw over the colour tools)

yes, the touch screen gives us higher information, however, my paint app paints directly to a frame buffer and uses page flipping. its optimized for local hardware, and dont want to have to deal w/ RAM buffers just yet (which will also require resizing code)


like i just said tho, we have already ran the tests for coords n such, and i think ive perfected the calibration method over the current existing one. i just wanna know if it works w/ everyone elses calibration settings. so far, i have 3 yes and 0 no.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#38553 - Lynx - Tue Mar 29, 2005 1:56 am

Looks perfect to me.. :D

#38575 - ecurtz - Tue Mar 29, 2005 6:02 am

Works perfectly.

As does the PassMe I got from Lynx (although the connectors I soldered myself are a little bit flakey.)

Great work guys!

- eli

#38596 - darkfader - Tue Mar 29, 2005 1:44 pm

Very close :)
Vertically, it seems to result about 101% of touched position. Bit too low and high. Might be temperature related?

#39165 - Kola - Tue Apr 05, 2005 2:15 pm

Works perfect, the other version didn't quite go all the way to the right side of the screen, but this one is fine.
_________________
k o l a

#39169 - Lynx - Tue Apr 05, 2005 2:49 pm

Actually, as mentioned in another post... If you tap the screen a few times, lines will shoot accross the screen, as if drawing from a random point to where you are tapping.

Any idea on what is causing this?

#39185 - josath - Tue Apr 05, 2005 7:29 pm

maybe when the pen is just leaving or just touching the screen, it registers that there is a touch, but the touch is so light that the x,y is not accurate? perhaps we need to take into account the 'pressure', and if the pressure is very low, disregard the touch?

#39192 - tepples - Tue Apr 05, 2005 8:48 pm

Josath, you're on exactly the right track.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#39194 - josath - Tue Apr 05, 2005 9:01 pm

or maybe, if you tap it quickly, you see the tap, but by the time you read the x and y, the pen is no longer in contact, so you get 0,0? not sure exactly what the 'random lines' look like, are they always connected to 0,0?

#39195 - The 9th Sage - Tue Apr 05, 2005 9:24 pm

your code seems pretty accurate to me...it feels easier to write legibly than in Pictochat even. The only problem is the strange random line thing, but it seems y'all already know about that. Anyway, much better than before.

#39228 - Lynx - Wed Apr 06, 2005 6:10 am

Nope :( Not 0,0 all the time.. It's random, all over the screen.. But, appears to be toward the bottom of the screen if that helps..

#39256 - Darkain - Wed Apr 06, 2005 4:40 pm

ive actually known about this for a while. it IS an issue w/ accuracy. try touching 2 locations at the same time, and see what happens. ;)

i will be adding an accuracey threshold here in the near future.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#39659 - thetictacaddict - Mon Apr 11, 2005 3:57 am

The line is really close to the stylus, a pixel or two to the upper right. I can draw all the way to the edges of the screen, and I like the fact that I can clear the drawing area. I get the shooting lines too.

Touching the screen in two places is interesting... it's pretty much the same as in PictoChat.