b. Plotting Points with Parameters

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 05 - Plotting Points >

b. Plotting Points with Parameters

This section shows how to plot points with different parameters such as radius and color using the commands PointRadius() and PointColor().

 

 

Command Prototype

 

uint16_t PointRadius(int Radius)

uint16_t PointColor(uint32_t argb)

 

Parameters

Description

Radius

radius of the point

argb

Color value (For ex: yellow, green, red etc.)

 

 

Code

 

 

void setup()

{

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

 CleO.begin();

 

/* Start building a screen frame */

 CleO.Start();

 

 /* select point radius - 3 */

 CleO.PointRadius(3);

 

/* select point color - red */

 CleO.PointColor(RED);

 

for (int x = 10; x < 800; x += 20)

   for (int y = 10; y < 480; y += 20)

 

/* draw a point at (x, y) coordinate */

     CleO.Point(x, y);

 

/* Display completed screen frame */

 CleO.Show();

}

 

void loop()

{

}

 

 

Description

 

The above code snippet draws red points with radius 3 covering the full screen.

 

 

Output

 

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

 

Tutorials05-PointParametersXYRadiusColor.50