c. Gauge Widget

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 18 - Built-In FT81x Widgets >

c. Gauge Widget

A Gauge widget depicts the value of a specified attribute or a count of features as a percentage of a target value.  This section shows how to draw the Gauge widget with various parameters using the eve_gauge() command.



Command Prototype


uint16_t eve_gauge(int x, int y, int16_t r, int16_t options, int16_t major, int16_t minor, int16_t val, int16_t range)





X-coordinate of gauge center, in pixels


Y-coordinate of gauge center, in pixels


Radius of the gauge, in pixels


By default the gauge dial is drawn with a 3D effect and the value of options is zero. OPT_FLAT removes the 3D effect. With option OPT_NOBACK, the background is not drawn. With option OPT_NOTICKS, the tick marks are not drawn. With option OPT_NOPOINTER, the pointer is not drawn.


Number of major subdivisions on the dial, 1-10


Number of minor subdivisions on the dial, 1-10


Gauge indicated value, between 0 and range, inclusive


Maximum value






void setup()


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



/* Start building a screen frame */


 int x = 400, y = 240;

 uint16_t r = 75, major = 4, minor = 3;

 uint16_t options = 0;

 uint16_t value1 = 24000;

 uint16_t value2 = 12000;

 uint16_t value3 = 48000;

 uint16_t range = 65535;


/* Draw gauge with various values */

 CleO.eve_gauge(x, y - 160, r, options, major, minor, value1, range);

 CleO.eve_gauge(x, y, r, options, major, minor, value2, range);

 CleO.eve_gauge(x, y + 100, r, options, major, minor, value3, range);


/* Display completed screen frame */




void loop()







In the above code snippet, the eve_gauge() command is used to draw three gauge widgets. Gauge widgets are drawn at (x,y) with radius r. By default, the gauge dial is drawn with a 3D effect, and the value of options is set as zero. The options parameter refers to any of the following -



OPT_FLAT                removes the 3D effect

OPT_NOBACK        background is not drawn

OPT_NOTICKS        tick marks are not drawn

OPT_NOPOINTER        pointer is not drawn.





Here is the output displayed upon executing the code snippet -