a. Drawing a Simple Needle

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 08 - Drawing Needles >

a. Drawing a Simple Needle

This section shows how to draw a simple needle using the Needle() and NeedleWidth() commands.

 

 

Command Prototype:

 

uint16_t Needle(int X1,int Y1,int X2,int Y2)

uint16_t NeedleWidth(int Width)

 

Parameters

Description

X1 Y1

(x1,y1) coordinate, start point of the needle

X2 Y2

(x2,y2) coordinate, end point of the needle

Width

Needle Width

 

 

Code

 

 

void setup()

{

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

 CleO.begin();

 

/* Start building a screen frame */

 CleO.Start();

 

 /* Select needle width*/

 CleO.NeedleWidth(20);

 

 /* Draw needle from (30, 30) to (800, 480) */

 CleO.Needle(30, 30, 800, 480);

 

 /* Display completed screen frame */

 CleO.Show();

}

 

void loop()

{

}

 

Description

 

The above code snippet draws a needle from (30,30) to (800,480) with needle width parameter set at 20 using the Needle() command. The needle's default color is White.

 

 

Output

 

Here is the output displayed upon executing the above code snippet -

 

Tutorials08-DrawingNeedles.50