Displaying Images and Icons on GLCD
In this tutorial we will see how to display the images/icons on 128x64 Monochrome GLCD. To do this we need images of 128x64 pixels, if not we have to crop/resize the higher resolution images. This can be done using photoshop or some other photo editors. We will be using the windows built in tool PAINT.
Image Resize
Lets take a high resolution image and crop it to 128x64 and then generate the bitmap.
Download and open the above image using ms paint as shown below.
Resize the image to 128x64 pixels.
Save the image in monochrome bitmap format .bmp as shown below.
Bitmap Using Lcd Assistant
Now run the LCD Assistant software and load the monochrome image saved in the previous step.
Do the setting as shown in the image.
Click on FILE->Save Output and save the output file as logo.txt
The bitmap for the image will be saved in an array as shown in the below image.
Use this array in your code for displaying the image/logo on the GLCD.
Code
Below is the complete code with the bit map array.
Check glcd.h file for pin connection.
#include "glcd.h" | |
#include "delay.h" | |
const unsigned char IPL_Logo [] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, | |
0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, | |
0x88, 0x84, 0xC4, 0x42, 0x43, 0x41, 0x41, 0x41, 0x80, 0x00, 0x40, 0x80, 0x00, 0x00, 0x20, 0x01, | |
0x01, 0x03, 0x03, 0x07, 0x1F, 0x3E, 0xFC, 0xF8, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, | |
0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, | |
0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x09, 0x01, 0x01, 0x01, 0x00, 0x00, 0x38, | |
0x7C, 0x7C, 0xFC, 0x7C, 0xF8, 0xF0, 0x00, 0xC0, 0xE0, 0xF8, 0xFF, 0x7F, 0x1E, 0x02, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x7F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x0F, 0x1F, 0x3E, 0x7C, 0xF8, 0xF0, 0xE0, | |
0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x83, 0xFF, 0xFF, 0x7E, 0x00, | |
0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0x7C, 0x47, 0x47, 0x7F, 0xFF, 0xF8, 0xE0, | |
0x80, 0x00, 0x00, 0xFF, 0xFF, 0x07, 0x0F, 0x1E, 0x3C, 0x78, 0xF0, 0xE0, 0xFF, 0xFF, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x03, 0x1F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x00, | |
0x00, 0x00, 0x80, 0x20, 0x10, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0xE3, 0xE3, 0xE3, 0x20, 0x20, 0xE0, 0xE3, 0xC3, 0x80, 0x00, 0x00, 0xE0, 0xE0, 0xE1, 0x23, | |
0x63, 0xE0, 0xE0, 0xC0, 0x83, 0x03, 0x03, 0xE2, 0xE2, 0xE2, 0x23, 0x21, 0x21, 0x20, 0x00, 0x00, | |
0x00, 0xE3, 0xE3, 0xE3, 0xC0, 0x00, 0x03, 0x03, 0x00, 0x00, 0x80, 0xE0, 0xE0, 0xE0, 0x03, 0x03, | |
0x03, 0xE2, 0xE0, 0xE3, 0xE3, 0x00, 0x00, 0xE0, 0xE0, 0xE0, 0x20, 0x21, 0x23, 0x23, 0x00, 0x00, | |
0x00, 0xE0, 0xE0, 0xE0, 0x20, 0x60, 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | |
0xFE, 0xFF, 0xF8, 0xF0, 0xE0, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x04, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x08, | |
0x3C, 0x7F, 0xF7, 0xE3, 0xC1, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xC6, 0x84, 0x84, 0xC4, 0xC0, 0x00, | |
0xC0, 0xFF, 0x03, 0x07, 0x1F, 0x7F, 0xFC, 0xF0, 0x78, 0x0E, 0x03, 0x03, 0xFF, 0xFF, 0xFC, 0x00, | |
0x00, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xC4, 0x84, 0x84, 0xC4, 0xC0, 0x00, | |
0x00, 0xFF, 0xFF, 0xFF, 0x08, 0x3C, 0x7F, 0xF7, 0xE3, 0xC1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, | |
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x5E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xF8, 0xF8, 0xF8, 0x08, 0x08, | |
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x38, 0xF8, 0xF8, 0xC0, 0x00, 0x00, 0x00, 0x00, | |
0xE0, 0xF0, 0xF0, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0xF8, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0xF8, 0x08, 0x08, 0x08, | |
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xFC, 0xFE, 0x7F, 0x7F, 0xBF, 0xBF, 0x3F, 0x1F, | |
0x0F, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x3F, 0x3F, 0x3F, 0x30, 0x20, 0x20, 0x30, 0x30, 0x00, 0x38, 0x3F, 0x3F, 0x3F, 0x21, 0x21, | |
0x31, 0x30, 0x00, 0x20, 0x38, 0x1E, 0x07, 0x06, 0x06, 0x07, 0x07, 0x1F, 0x3F, 0x3C, 0x30, 0x01, | |
0x0F, 0x1F, 0x1F, 0x38, 0x30, 0x20, 0x20, 0x36, 0x3E, 0x3E, 0x02, 0x00, 0x00, 0x0F, 0x1F, 0x3F, | |
0x30, 0x20, 0x20, 0x20, 0x30, 0x1C, 0x0F, 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F, 0x21, 0x21, 0x31, | |
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x01, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
}; | |
/* start the main program */ | |
void main() | |
{ | |
GLCD_Init(); | |
GLCD_DisplayLogo(IPL_Logo); | |
while(1); | |
} |
Downloads
Download the complete project folder from this link: Hardware design Files and Code Library
LCD Assistant software.
Have an opinion, suggestion , question or feedback about the article let it out here!
Ultra PIC Board Test
The Explore Ultra PIC Kit comes with all the things required, not just for this experiment but for the entire series. And even if you think of migrating to PIC or Arduino, you'll have breakout...

Cp2102 Usb-to-Serial Driver Installation
In this tutorial, we will see how to install the Cp2102 Usb to Serial Drivers. Download the Usb2Serial drivers for this link and follow the below steps to install the Usb-To-Serial drivers...

Flashing Hex File Using Pickit2
In this tutorial we will see how to upload hex file using the below PICKit 2 programmer. Installing Pickit 2 Software Download and Install the Pickit2 software from...

PIC Software Setup
In this tutorial we will see how to setup a Mplabx project to generate .hex file for Pic16f877a MPLABx Setup Steps Step1: Open the MPLABx software and select the...