#39004 - sashswash - Sun Apr 03, 2005 2:12 am
Hey Guys -
I'm new to the DS/GBA developing scene, but so far i'm working on developing a simple keyboard / button interface. I am using the console functions, and a button class i created, to place "buttons" on screen. The problem that i am having is lining up the buttons with where the touchscreen reads the input (it is a calibration issue). Here is some code:
typedef struct {int x,y;} COORD; // A coordinate structure
COORD temp;
temp.y = (IPC->touchY)/193;
the '/193' for the temp.y value seems to produce the most accurate results. However, because i am using division, the amount of error in the calculation increases as i move the stylus down the screen. Do you guys have any suggestions or examples of calibration code?
Basically, i need to divide the touchscreen into a grid of 32x24 "touch areas".
I'm new to the DS/GBA developing scene, but so far i'm working on developing a simple keyboard / button interface. I am using the console functions, and a button class i created, to place "buttons" on screen. The problem that i am having is lining up the buttons with where the touchscreen reads the input (it is a calibration issue). Here is some code:
typedef struct {int x,y;} COORD; // A coordinate structure
COORD temp;
temp.y = (IPC->touchY)/193;
the '/193' for the temp.y value seems to produce the most accurate results. However, because i am using division, the amount of error in the calculation increases as i move the stylus down the screen. Do you guys have any suggestions or examples of calibration code?
Basically, i need to divide the touchscreen into a grid of 32x24 "touch areas".