LEDBar. A versatile numeric display
The LED control is just a single component that can be used
in many ways. The LEDBar aggregates a number of LEDControl objects to make a
display that can show any numeric information. The character displays can handle
decimal and hexadecimal values so the LEDBar can show decimal integer,
floating-point, hexadecimal, octal and binary values easily. This is ideal for
many instrumentation projects.
The LEDBar can have almost any number of digits. The
practical limits are obvious of course but 4, 8 10 or even 50 digits are usable.
The bar automatically lays out the digits in much the same way as the LEDClock
control by arranging them left-to-right across the width of the control.
The bar uses a similar method to the LEDClock to format the
data. A numeric string is formatted with a particular format specification and
the characters in the string used to update the individual LEDControl objects in
the bar. In this manner the following formats are supported:
-
Decimal Integer.
-
Fixed Point.
-
Floating Point.
-
Hexadecimal.
-
Octal.
-
Binary.
The LEDBar has a property for the number of digits and each
time this is changed the LEDControls are
removed and the bar is repopulated with new ones.
The full listing for the LEDBar is shown here and a test
harness that shows off the capabilities of the controls shown in this article is
included in the code page.

A selection of LED displays.
You can find the Source Code files here.
Return to the main index.