displayio_gauge

Displayio widget that creates circular gauges that can have their fill value set dynamically.

  • Author(s): GaryZ

Implementation Notes

Hardware:

Any display that supports displayio.

Software and Dependencies:

class displayio_gauge.Gauge(*args: Any, **kwargs: Any)

A circular gauge that can be filled to a certain value. The origin is set using x and y coordinates relative to the center of the gauge.

Parameters:
  • x (int) – pixel position relative to center

  • y (int) – pixel position relative to center

  • radius (int) – radius of outer circle of the gauge

  • thickness (int) – thickness of the gauge in pixels defaults to 10 pixels

  • level (int) – fill level of the gauge (0-100) defaults to 0

  • outline_color (int) – the color for the outline of the gauge defaults to 0xFFFFFF

  • foreground_color (int) – the color for filled in portion of the gauge 0x00FF00

  • background_color (int) – the color for the unfilled portion of the gauge 0x000000

Simple example of a gauge with level set by for loop

See file: examples/displayio_gauge_simpletest.py

property background_color

The gauge’s background color that will be used in the unfilled portion of the gauge.

property foreground_color

The gauge’s foreground color that will be used to fill up to the level that is set.

property level

The gauge’s current level.

property outline_color

The gauge’s background color that will be used to draw the edge lines of the gauge.