Contents Previous Next

## 12.2 Generating LED-like digits with JpGraph

Starting with v1.21 it is possible to generate LED like digits with JpGraph. This is accomplished by the usage of the "jpgraph_led.php" module.

The creation of LED digits and letters are extremely simple. The following complete example demonstrates the creation of a LED display

`
include "../jpgraph.php";
include "../jpgraph_led.php";
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74 ();
$led->Stroke( '0123456789. ABCDEFGHIJKL', LEDC_GREEN);
`

The result of running this script can be seen by running the "Examples/ledex1.php" Example in the example directory. As can be seen from the above example the color to be used for the LED digits is specified as the second argument to the DigitalLED74::Stroke() method. Available color for LED digits is given by the table below

Symbolic name | Color
LEDC_RED | Red
LEDC_GREEN | Green
LEDC_BLUE | Blue
LEDC_YELLOW | Yellow
GREY | Grey

Since the standard LED matrix of 7x4 dots does not lend itself to accurately represent all normal ASCII characters only the following numbers and letters can be displayed.

All digits, 0-9
Capital Letters, A-L

Contents Previous Next