#42096 - Pacifist - Thu May 05, 2005 9:26 pm
I've been using Darkain's calibration code to read the touch-screen.
Like everyone else it works very well for me except that I get those shooting lines into the middle of the screen when using the darkstar paint program.
I've found a way to eliminate this effect in my own project using natrium42's under pressure code.
Instead of reading the DS's guess at if the pen is down
You roll your own touchPressed method by stealing natruims code straight out of his demo:
Using a MAX_PRESSURE of 70 I get no anomolous readings and, strangely enough, a more sensitive touch pad.
I am worried that all the DS's are going to have different touch threshholds though and am curious about other people's findings with this code.
(when experimenting remember that lower numbers represent higher pressures)
Like everyone else it works very well for me except that I get those shooting lines into the middle of the screen when using the darkstar paint program.
I've found a way to eliminate this effect in my own project using natrium42's under pressure code.
Instead of reading the DS's guess at if the pen is down
Code: |
return( ((~IPC->buttons) << 6) & (1<<12) ); |
You roll your own touchPressed method by stealing natruims code straight out of his demo:
Code: |
int TouchPad::touchPressed() { uint16 touchZ1 = IPC->touchZ1; uint16 touchZ2 = IPC->touchZ2; uint16 touchX = IPC->touchX; uint16 pressure = (touchX * touchZ2) / (64 * touchZ1) - touchX / 64; if( pressure > 0 && pressure < MAX_PRESSURE ) return 1; else return 0; } |
Using a MAX_PRESSURE of 70 I get no anomolous readings and, strangely enough, a more sensitive touch pad.
I am worried that all the DS's are going to have different touch threshholds though and am curious about other people's findings with this code.
(when experimenting remember that lower numbers represent higher pressures)