e. Drawing Needle Segments

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 08 - Drawing Needles >

e. Drawing Needle Segments

This section shows how to draw  needle segments using the commands - Needle(), NeedleWidth() and NeedleColor().

 

 

Command Prototype:

 

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

uint16_t NeedleWidth(int Width)

uint16_t NeedleColor(uint32_t argb)

 

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

argb

Color values (for example - red, yellow, green etc.)

 

 

Code

 

 

void setup()

{

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

 CleO.begin();

 

/* Start building a screen frame */

 CleO.Start();

 

 CleO.NeedleWidth(20);

 CleO.NeedleColor(RED);

 CleO.Needle(10, 200, 310, 200);

 CleO.Needle(310, 250, 10, 250);

 

 /* Display completed screen frame */

 CleO.Show();

}

 

void loop()

{

}

 

 

Description

 

The above code snippet draws two needle segments from (10,200) to (310,200) and (310,250) to (10,250).

 

 

Output

 

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

 

DrawingNeedleSegments