12 years, 5 months ago.

Mini-DK Touchscreen Calibration Values

Frank,

What parameters are required for saving / restoring calibration values so you don't have to re-calibrate after each reboot?

...kevin

3 Answers

12 years, 5 months ago.

matrix struct. you can find matrix in touch.h

12 years, 5 months ago.

Kevin,

Sorry i missed your Question about the calibation value. Davide's answer is correct.

In order to get a faster reply, i think it should be better to post such questions directly on the Mini-DK notebook page at http://mbed.org/users/frankvnk/notebook/lpc1768-mini-dk/. This also allows us to keep info relevant to the Mini-DK at one location.

Kevin Braun
poster
12 years, 5 months ago.

Thanks Davide and Frank,

I seem to be having a problem getting the calibration data after calibration. The data I print out while in TouchScreenADS7843::setCalibrationMatrix is totally different from the data I get from a main call. It's like the data pointer is not at the correct memory location in main.

Matrix idx, *mPTR;

mPTR = &idx;

void CheckTftCal() {

if(TftCalib == 1) {

pc.printf("Calibrating touchpad.....\n");

tt.cls();

tt.set_orientation(0);

tch.TouchPanel_Calibrate(); calibrate the touch

Ann = mPTR->An;

Bnn = mPTR->Bn;

Cnn = mPTR->Cn;

Dnn = mPTR->Dn;

Enn = mPTR->En;

Fnn = mPTR->Fn;

Divnn = mPTR->Divider;

...kevin

Kevin,

When you look at Touch.h (http://mbed.org/users/frankvnk/code/Mini-DK/file/6816fa47b39e/TouchADS7843/Touch.h), you can see that DisplaySample, ScreenSample and matrix are in the 'protected' part, so they are not visible to main().

This is clearly a shortcoming of my code (should have thought about adding the possibility to store/return the calibration data).

The easiest way to acces the matrix:

In Touch.h, move Matrix matrix; from protected: to public:

Now you can access the matrix values in your main():

TouchScreenADS7843 tch.....

...

printf("%08X\n",tch.matrix.An);

printf("%08X\n",tch.matrix.Bn);

....

Sidenote : to improve readability when posting code, use <<code>> <</code>> (see the editing tips).

posted by Frank Vannieuwkerke 06 Apr 2013

thank you Frank,

All is right with the world now.

...kevin

posted by Kevin Braun 08 Apr 2013