c. Plotting Points at Angles

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 05 - Plotting Points >

c. Plotting Points at Angles

This section shows how to draw points at an angle using the PointExt() command.

 

 

Command Prototype

 

uint16_t PointExt( int X, int Y, int Radius, uint32_t Color, int16_t Angle, int Radiusat)

 

Parameters

Description

X,Y

Center (x,y) coordinates

Radius

radius of the point

Color

Point color

Angle

required angle value for the point

Radiusat

distance from center

 

 

Code

 

 

void setup()

{

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

 CleO.begin();

 

/* Start building a screen frame */

 CleO.Start();

 

 for (int deg = 0; deg < 360; deg += 6)

 {

  /* Draw white point at 150 distance from center (160, 235) with a radius of 4 */

   CleO.PointExt(160, 235, 4, WHITE, deg, 150);

 }

 

 /* Display completed screen frame */

 CleO.Show();

}

 

void loop()

{

}

 

 

Description

 

The above code snippet draws a set of points in the for loop.

In each iteration, the degree of angle is changed by 6 degrees.

 

 

Output

 

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

 

PlottingPointsAtAngle