a. Drawing Lines between Two Points

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 04 - Drawing Lines >

a. Drawing Lines between Two Points

This section shows how to draw a line between two points using the Line() command.



Command Prototype


uint16_t Line(int X1, int Y1, int X2, int Y2);




X1, Y1

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

X2, Y2

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






void setup()


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



/* Start building a screen frame */



/* draw a line on screen connecting two points (10, 10) & (310, 470) */

 CleO.Line(10, 10, 310, 470);


 /* Display completed screen frame */




void loop() { }





The above code snippet draws a line that starts at (10, 10) and ends at (310, 470).





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