| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="121GeneratingAntiSpamchallenge.html">
|
|
|
8 |
<LINK REL="Next" HREF="1221AdjustingthesizeoftheLEDdigits.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="121GeneratingAntiSpamchallenge.html">Previous</A>
|
|
|
26 |
<A HREF="1221AdjustingthesizeoftheLEDdigits.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="12_2">12.2 Generating LED-like digits with JpGraph</A></H2>
|
|
|
29 |
Starting with v1.21 it is possible to generate LED like digits with
|
|
|
30 |
JpGraph. This is accomplished by the usage of the "jpgraph_led.php"
|
|
|
31 |
module.
|
|
|
32 |
<P> The creation of LED digits and letters are extremely simple. The
|
|
|
33 |
following complete example demonstrates the creation of a LED display<DIV
|
|
|
34 |
class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
35 |
<BR>
|
|
|
36 |
<BR></FONT><FONT color="#007700">include </FONT><FONT color="#DD0000">
|
|
|
37 |
"../jpgraph.php"</FONT><FONT color="#007700">;
|
|
|
38 |
<BR>include </FONT><FONT color="#DD0000">"../jpgraph_led.php"</FONT><FONT
|
|
|
39 |
color="#007700">;
|
|
|
40 |
<BR>
|
|
|
41 |
<BR></FONT><FONT color="#FF8000">
|
|
|
42 |
// By default each "LED" circle has a radius of 3 pixels
|
|
|
43 |
<BR></FONT><FONT color="#0000BB">$led </FONT><FONT color="#007700">
|
|
|
44 |
= new </FONT><FONT color="#0000BB">DigitalLED74</FONT><FONT color="#007700">
|
|
|
45 |
();
|
|
|
46 |
<BR></FONT><FONT color="#0000BB">$led</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
47 |
color="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
48 |
'0123456789. ABCDEFGHIJKL'</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
49 |
LEDC_GREEN</FONT><FONT color="#007700">);
|
|
|
50 |
<BR></FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
51 |
<P> The result of running this script can be seen by running the
|
|
|
52 |
"Examples/ledex1.php" Example in the example directory. As can be seen
|
|
|
53 |
from the above example the color to be used for the LED digits is
|
|
|
54 |
specified as the second argument to the DigitalLED74::Stroke() method.
|
|
|
55 |
Available color for LED digits is given by the table below</P>
|
|
|
56 |
<TABLE>
|
|
|
57 |
<TR><TD>Symbolic name</TD><TD>Color</TD></TR>
|
|
|
58 |
<TR><TD>LEDC_RED</TD><TD>Red</TD></TR>
|
|
|
59 |
<TR><TD>LEDC_GREEN</TD><TD>Green</TD></TR>
|
|
|
60 |
<TR><TD>LEDC_BLUE</TD><TD>Blue</TD></TR>
|
|
|
61 |
<TR><TD>LEDC_YELLOW</TD><TD>Yellow</TD></TR>
|
|
|
62 |
<TR><TD>GREY</TD><TD>Grey</TD></TR>
|
|
|
63 |
</TABLE>
|
|
|
64 |
Since the standard LED matrix of 7x4 dots does not lend itself to
|
|
|
65 |
accurately represent all normal ASCII characters only the following
|
|
|
66 |
numbers and letters can be displayed.
|
|
|
67 |
<TABLE>
|
|
|
68 |
<TR><TD>All digits, 0-9</TD></TR>
|
|
|
69 |
<TR><TD>Capital Letters, A-L</TD></TR>
|
|
|
70 |
</TABLE>
|
|
|
71 |
<HR NOSHADE>
|
|
|
72 |
<A HREF="toc.html">Contents</A>
|
|
|
73 |
<A HREF="121GeneratingAntiSpamchallenge.html">Previous</A>
|
|
|
74 |
<A HREF="1221AdjustingthesizeoftheLEDdigits.html">Next</A>
|
|
|
75 |
</BODY>
|
|
|
76 |
</HTML>
|