11.4 PROJECT 11.4 – Creating Custom Fonts on the LCD

There are some applications where we may want to create custom fonts, such as special characters, symbols or logos on the LCD. This project will show how to create the symbol of an arrow pointing upwards on the LCD, and then display ‘Up arrow - <symbol of up arrow>’ on the first row of the LCD.

mikroC Pro for PIC compiler provides a tool that makes the creation of custom fonts very easy. The steps for creating a font of any shape are given below:

  • Start mikroC Pro for PIC compiler.
  • Select Tools -> LCD Custom Character. You will see the LCD font editor form shown in Figure 11.11.
  • Select 5 × 7 (the default).
  • Click ‘Clear all’ to clear the font editor.
  • Now, draw the shape of your font by clicking on the squares in the editor window. In this project, we will be creating the symbol of an ‘up arrow’, as shown in Figure 11.12.
  • When you are happy with the font, click the ‘mikroC Pro for PIC’ tab so that the code generated will be for the mikroC Pro for PIC compiler.
  • Click Generate Code' button. You will get the code, as shown in Figure 11.13.
  • Click ‘Copy Code To Clipboard’ to save the code.
  • We shall see later in the project how to display this font using the generated code.

Figure 11.11 LCD font editor

img

Figure 11.12 Creating an ‘up arrow’ font

Figure 11.13 Generating code for the font

11.4.1 Block Diagram

The block diagram of the ...

Get Using LEDs, LCDs and GLCDs in Microcontroller Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.