d. Drawing Angled Needles with Parameters

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 08 - Drawing Needles >

d. Drawing Angled Needles with Parameters

This section shows how to draw needles at various angles with different parameters like color, radius and angle parameters using the command NeedleExt().

 

 

Command Prototype

 

uint16_t NeedleExt(int X, int Y, int Length, uint32_t Color, int16_t Angle, int Radius)

 

Parameters

Description

X, Y

(x,y) coordinates

Length

Needle length

Color

Needle color

Angle

Angle at which the needle will be drawn

Radius

radius of the needle

 

 

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 at (400, 240) with 230 angle, 100 length and 20 radius */

 CleO.NeedleExt(400, 240, 100, LIGHT_GREEN, 230, 20);

 

/* Display completed screen frame */

 CleO.Show();

}

 

void loop()

{

}

 

 

Description

 

The above code snippet draws a needle at (400,240) with LIGHT_GREEN color, at an angle of  230 degrees and 20-degree radius.

 

 

Output

 

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

 

Tutorials08-AngleNeedleParametersXYColorAngleRadius.50