a. Screen Calibration

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 19 - Miscellaneous Commands >

a. Screen Calibration

This section shows how to perform screen calibration using the Calibration() command.

 

 

Command Prototype

 

uint16_t Calibration()

 

 

Code

 

 

void setup()

{

/* Initialize CleO - needs to be done only once */

 CleO.begin();

 

/* Start screen calibration */

 CleO.Calibration();

}

 

void loop()

{

 int16_t x, y, dur, tag;

 CleO.TouchCoordinates(x, y, dur, tag);

 CleO.Start();

 CleO.StringExt(FONT_MEDIUM, 160, 150, LIGHT_GREEN, MM, 0, 0,

 "touch test started");

 

 if (dur)

   CleO.CircleExt(x, y, 10, 20, DARK_ORANGE, MM, 0, 0);

 else

   CleO.StringExt(FONT_MEDIUM, 160, 240, LIGHT_GREEN, MM, 0, 0,

   "no touch detected");

 

 CleO.Show();

}

 

 

Description

 

The above code snippet shows that you are only required to call the Calibration() command which will initiate the calibration sequence by prompting the users to touch the predefined points on the screen.

Upon successfully calibrating, the touch test will start.

A circle will be drawn on the screen with touch points as a center point.

 

 

Output

 

Here is the output displayed upon executing the code snippet -

 

Screen Calibration