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)




X1 Y1

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

X2 Y2

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


Needle Width






void setup()


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



/* Start building a screen frame */



 /* Select needle width*/



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

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


 /* Display completed screen frame */




void loop()






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.





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