d. Sketch Pad Input

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 14 - CleO Utility Widgets >

d. Sketch Pad Input

This section shows how to use the Sketch Pad widget. You may use the Sketch() command to get a sketch on screen.

 

 

Command Prototype

 

uint16_t Sketch(int X, int Y, int Width, int Height);

 

Parameters

Description

X Y

x,y screen coordinates

Width

sketch area width

Height

sketch area height

 

 

Code

 

 

void setup()

{

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

 CleO.begin();

 

/* Start building a screen frame */

 CleO.Start();

 

/* Enable sketching on the screen */

CleO.Sketch(0, 0, 800, 480);

 CleO.StringExt(FONT_MEDIUM, 400, 240, YELLOW, MM, 0, 0, "START SKETCHING");

 

 /* Display completed screen frame */

 CleO.Show();

}

 

void loop() { }

 

 

Description

 

The above code snippet shows how to start sketching using the Sketch() command.

 

Note: Make sure to perform the screen calibration. For details, refer to Tutorial 19 - Miscellaneous Commands > a. Screen Calibration.

 

 

Output

 

Here is the output displayed upon executing the code snippet -

 

SKETCHING