LK202-24-USB rev 1
20
4. Bar Graphs and Special Characters
The LK202-24-USB includes the ability to draw bar graphs (either horizontal or vertical) and allows users
to define up to eight special characters.
Before issuing commands to the LK202-24-USB please read
sections 6.2 and 6.3.
Eight characters (ASCII values 0x00 to 0x07) are set aside for use with bar graphs, user defined characters,
and big numbers. Since the same 8 characters are used for each function, the functions may not be used
simultaneously. The characters may be defined or redefined at any time by issuing the commands shown in
this section. Once defined, they may be used either by means of the bar graph commands, or by simply
issuing one of the ASCII values 0x00 to 0x07 (which is not prefixed by the command byte, 254).
4.1 Command List
4.1.1 Initialize wide vertical bar graph (254 118)
This command defines the 8 special/user characters to be blocks suitable for use in drawing wide (5 pixel)
vertical bar graphs. Any previously existing definitions will be lost. Once this command has been issued,
any number of vertical bar graphs may be drawn unless the characters are redefined by another command.
4.1.2 Initialize narrow vertical bar graph (254 115)
This command defines the 8 special/user characters to be blocks suitable for use in drawing narrow (2 pixel)
vertical bar graphs. Any previously existing definitions will be lost. Once this command has been issued,
any number of vertical bar graphs may be drawn unless the characters are redefined by another command.
4.1.3 Draw vertical bar graph (254 61 [column] [height])
Draws a vertical bar graph in [column] having a height of [height] pixels. The height may range from 0 to
20 (0x00 to 0x14) pixels. The necessary characters must first be initialized by either of the commands
shown in section 4.1.1 or 4.1.2, which will determine the width of the graph drawn. Graph may be erased by
drawing a bar graph of height = 0 in the same column.
4.1.4 Initialize horizontal bar graph (254 104)
This command defines the 8 special/user characters to be blocks suitable for use in drawing horizontal bar
graphs. Any previously existing definitions will be lost. Once this command has been issued, any number of
horizontal bar graphs may be drawn unless the characters are redefined by another command.
4.1.5 Draw horizontal bar graph (254 124 [column] [row] [dir] [length])
Draws a horizontal bar graph in [row] starting at [column] with a length of [length] pixels. [row] may have a
value of 0x01 or 0x02, column may range from 0x01 to 0x14 and length may be from 0x00 to 0x64 (0 to
100) if the graph can extend the full width of the screen. Each column is 5 pixels wide (spaces between the
columns don't count).
[dir] specifies the direction: 0x00 goes from left to right, 0x01 goes from right to left.
4.1.6 Define custom character (254 78 [c] [8 bytes])
The LK202-24-USB allows up to 8 user defined (custom) characters. These characters occupy the first 8
(0x00 to 0x07) places in the character set (see Figure 2-5).