I have the hardware pattern setting for the touch panel set to "Manual" and would like to set it to "Preset". This would save me manually calibrating the screen every time after flashing the micro. I find manually calibrating the same screen every time quite time consuming and unnecessary.
1. How is the preset values (A, B, C, D, E, and F) calculated?
2. How can the values A, B, C, D, E and F be read after the screen has been manually calibrated?
3. Would you be able to give me preset values that are working for my EveConnect? The values in the preset fields appear to have a touch mirror offset affect with the objects.
Thank you
ConnectEve (Ready for Xmega)Touch calibration constants
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Hello,
You can use FT800_TouchTransform_GetConfig function in order to obtain the A,B,C,D,E and F values.
You should repeat manual calibrate procedure few times and then use average values that you received.
Create project in VisualTFT(leave calibration active) with six label positioned on screen.
Add the following code to _main file:And call refresh_coordinates after InitVTFTStack function.
Best regards.
You can use FT800_TouchTransform_GetConfig function in order to obtain the A,B,C,D,E and F values.
You should repeat manual calibrate procedure few times and then use average values that you received.
Create project in VisualTFT(leave calibration active) with six label positioned on screen.
Add the following code to _main file:
Code: Select all
char txt_tmp[9];
TFT800TouchTransform CalibrateConstants;
void refresh_coordinates()
{
FT800_TouchTransform_GetConfig(&CalibrateConstants);
LongWordToHex(CalibrateConstants.TransformA, txt_tmp);
strcpy(Label1.Caption, txt_tmp);
LongWordToHex(CalibrateConstants.TransformB, txt_tmp);
strcpy(Label2.Caption, txt_tmp);
LongWordToHex(CalibrateConstants.TransformC, txt_tmp);
strcpy(Label3.Caption, txt_tmp);
LongWordToHex(CalibrateConstants.TransformD, txt_tmp);
strcpy(Label4.Caption, txt_tmp);
LongWordToHex(CalibrateConstants.TransformE, txt_tmp);
strcpy(Label5.Caption, txt_tmp);
LongWordToHex(CalibrateConstants.TransformF, txt_tmp);
strcpy(Label6.Caption, txt_tmp);
DrawScreen(&Screen1);
}
Best regards.
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Thanks Dejan. I have converted your code to Mikrobasic and it is working fine
Regards,
Regards,
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Hello,
i don't know why, but I can't convert that issue to Mikropascal for ARM(Stellaris).
I always get fault messages.
Can someone please give me a hint how to change the above Example to Mikropascal for ARM.
I still have my problems understanding this pointer stuff to 100%.
many thanks
Jürgen
i don't know why, but I can't convert that issue to Mikropascal for ARM(Stellaris).
I always get fault messages.
Can someone please give me a hint how to change the above Example to Mikropascal for ARM.
I still have my problems understanding this pointer stuff to 100%.
many thanks
Jürgen
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Code: Select all
procedure EveButton1OnClick();
var Txt : array[8] of char;
var pTTransformConfig: TFT800TouchTransform;
begin
FT800_TouchTransform_GetConfig(@pTTransformConfig);
LongWordToHex(pTTransformConfig.TransformA, txt);
strcpy(LabelA.Caption, txt);
LongWordToHex(pTTransformConfig.TransformB, txt);
strcpy(LabelB.Caption, txt);
LongWordToHex(pTTransformConfig.TransformC, txt);
strcpy(LabelC.Caption, txt);
LongWordToHex(pTTransformConfig.TransformD, txt);
strcpy(LabelD.Caption, txt);
LongWordToHex(pTTransformConfig.TransformE, txt);
strcpy(LabelE.Caption, txt);
LongWordToHex(pTTransformConfig.TransformF, txt);
strcpy(LabelF.Caption, txt);
DrawScreen(@Screen1);
end;
Must have been the heat.
Jürgen
Re: ConnectEve (Ready for Xmega)Touch calibration constants
twenty wrote:Thanks Dejan. I have converted your code to Mikrobasic and it is working fine
Regards,
Dear
Can you please help me out with converting above to Mikrobasic with some code?
I don't understand how to declare these.
Many thanks in advance,
Donald
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Dear All,
I'm still struggling to get the 'FT800_TouchTransform_GetConfig' routine working in Mikrobasic for AVR.
I see samples in C and Pascal but can anyone post some code in Mikrobasic, or convert above Pascal code into Mikrobasic for AVR?
The problem is how to determine all declaration...
Many thanks in advance!
Donald
I'm still struggling to get the 'FT800_TouchTransform_GetConfig' routine working in Mikrobasic for AVR.
I see samples in C and Pascal but can anyone post some code in Mikrobasic, or convert above Pascal code into Mikrobasic for AVR?
The problem is how to determine all declaration...
Many thanks in advance!
Donald
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Hi,
Try the following code (copy into user code VTFT):
Regards,
Try the following code (copy into user code VTFT):
Code: Select all
include Calibration_constants_types
include Calibration_constants_resources
#I Calibration_constants_driver.inc
#I Calibration_constants_objects.inc
sub procedure button1_ondown()
'-------------- User code declarations ---------------'
dim calibrateconstants as tft800touchtransform
dim txt_tmp as char[9]
sub procedure refresh_coordinates()
'-------------- End of User code declarations --------'
implements
'--------------------- User code ---------------------'
sub procedure refresh_coordinates()
FT800_TouchTransform_GetConfig(@CalibrateConstants)
LongWordToHex(CalibrateConstants.TransformA, txt_tmp)
strcpy(Label1.Caption, txt_tmp)
LongWordToHex(CalibrateConstants.TransformB, txt_tmp)
strcpy(Label2.Caption, txt_tmp)
LongWordToHex(CalibrateConstants.TransformC, txt_tmp)
strcpy(Label3.Caption, txt_tmp)
LongWordToHex(CalibrateConstants.TransformD, txt_tmp)
strcpy(Label4.Caption, txt_tmp)
LongWordToHex(CalibrateConstants.TransformE, txt_tmp)
strcpy(Label5.Caption, txt_tmp)
LongWordToHex(CalibrateConstants.TransformF, txt_tmp)
strcpy(Label6.Caption, txt_tmp)
DrawScreen(@Screen1)
end sub
'----------------- End of User code ------------------'
' Event Handlers
sub procedure button1_ondown()
refresh_coordinates()
end sub
end.
-
- Posts: 6
- Joined: 27 Jul 2017 00:17
Re: ConnectEve (Ready for Xmega)Touch calibration constants
I am using the supplied code. It does print to the screen to each label. I was expecting each TransformA, TransformB, etc. to be 32 bits long. But I am not getting that.
Mine prints this to the screen. It is like F is tacked onto E so E is really EF. Then D is really DEF. Then C is CDEF, etc. How can txt_tmpA contain all of the other txt_tmpX where X = B, C, D, E and F?
00007FFFFFFFFb4FFFFF00007FFF65b52
FFFFFFFFB4FFFFF00007FFF65B52
FFFB4FFFFF00007FFF65B52
FFFFF00007FFF65B52
00007FFF65B52
FFF65B52
So I tried to split it up into this below, but it does not work. Any ideas?
CalibrateConstants.TransformA=0x00007;
CalibrateConstants.TransformB=0xFFFFF;
CalibrateConstants.TransformC=0xFFFB4;
CalibrateConstants.TransformD=0xFFFFF;
CalibrateConstants.TransformE=0x00007;
CalibrateConstants.TransformF=0xFFF65B52;
FT812_TouchTransform_SetConfig(&CalibrateConstants);
Code: Select all
void refresh_coordinates()
{
FT812_TouchTransform_GetConfig(&CalibrateConstants);
LongWordToHex(CalibrateConstants.TransformA, txt_tmpA);
strcpy(LabelA.Caption, txt_tmpA);
LongWordToHex(CalibrateConstants.TransformB, txt_tmpB);
strcpy(LabelB.Caption, txt_tmpB);
LongWordToHex(CalibrateConstants.TransformC, txt_tmpC);
strcpy(LabelC.Caption, txt_tmpC);
LongWordToHex(CalibrateConstants.TransformD, txt_tmpD);
strcpy(LabelD.Caption, txt_tmpD);
LongWordToHex(CalibrateConstants.TransformE, txt_tmpE);
strcpy(LabelE.Caption, txt_tmpE);
LongWordToHex(CalibrateConstants.TransformF, txt_tmpF);
strcpy(LabelF.Caption, txt_tmpF);
DrawScreen(&Screen1);
}
00007FFFFFFFFb4FFFFF00007FFF65b52
FFFFFFFFB4FFFFF00007FFF65B52
FFFB4FFFFF00007FFF65B52
FFFFF00007FFF65B52
00007FFF65B52
FFF65B52
So I tried to split it up into this below, but it does not work. Any ideas?
CalibrateConstants.TransformA=0x00007;
CalibrateConstants.TransformB=0xFFFFF;
CalibrateConstants.TransformC=0xFFFB4;
CalibrateConstants.TransformD=0xFFFFF;
CalibrateConstants.TransformE=0x00007;
CalibrateConstants.TransformF=0xFFF65B52;
FT812_TouchTransform_SetConfig(&CalibrateConstants);
- darko.ilijevski
- Posts: 581
- Joined: 21 Mar 2017 16:57
Re: ConnectEve (Ready for Xmega)Touch calibration constants
Hello,
Those fields are actually members of a structure, not all are of the same size. You can find more about it, if you read the help (right click on the library in the library manager panel and then HELP)
For correct readings, you need to define a type of TFT812TouchTransform Also, read this article HERE in the knowledgebase, it might help you understand what's going on inside that function.
Other than that, try to allocate enough space for your labels (max expected length + 1 char), do not leave them at 0 as it might mess up the pointers - a most common error when updating labels.
Best regards
Those fields are actually members of a structure, not all are of the same size. You can find more about it, if you read the help (right click on the library in the library manager panel and then HELP)
For correct readings, you need to define a type of TFT812TouchTransform Also, read this article HERE in the knowledgebase, it might help you understand what's going on inside that function.
Other than that, try to allocate enough space for your labels (max expected length + 1 char), do not leave them at 0 as it might mess up the pointers - a most common error when updating labels.
Best regards
BR,
Darko
Darko