﻿ Tutorials > Tutorial 06 - Drawing Circles > b. Drawing Circle with Parameters

# b. Drawing Circle with Parameters

Navigation:  Tutorials > Tutorial 06 - Drawing Circles >

# b. Drawing Circle with Parameters

This section shows how to draw a circle with parameters like Color and Inner/Outer radius using the command CircleExt().

Command Prototype

uint16_t CircleExt(int X, int Y, int Radius1, int Radius2, uint32_t Color, just_t Justification, int16_t Angle, int Radiusat)

Parameters

Description

X,Y

(x,y) coordinates

Color

Circle color

Justification

Justification values (i.e MM,TL,BL, etc.)

Angle

Angle at which the circle will be drawn

Distance from center

Code

void setup()

{

/* Initialize CleO */

CleO.begin();

/* Draw 6 circles with a center circle and 5 circles at equal angle */

CleO.Start();

int cx = 400;

int cy = 240;

/* Draw center circle with 20 pixels thickness and dark orange in color */

CleO.CircleExt(cx, cy, 140, 160, DARK_ORANGE, MM, 0, 0);

/* Draw 5 circles each at 72 degrees starting from bottom down */

for (int a = 0; a < 360; a += 72)

CleO.CircleExt(cx, cy, 40, 50, LIGHT_BLUE, MM, a, 150);

/* Set the background color to be gradient from top left corner to  bottom right corner */

CleO.SetBackgroundGradient(0, 0, 800, 480, DARK_BLUE, DARK_RED);

/* Display completed screen frame */

CleO.Show();

}

void loop()

{

}

Description

The above code snippet draws a dark orange color circle (400, 240) center.

The loop() routine executes the CircleExt() command at an angle of 72 degrees for five times.

The background gradient is set with two colors - Dark Blue and Dark Red covering the full screen.

Output

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