Displaying Images and Icons on GLCD using PIC microcontroller

///Displaying Images and Icons on GLCD using PIC microcontroller
  • Displaying Images and Icons on GLCD using PIC microcontroller

Displaying Images and Icons on GLCD using PIC microcontroller

The GLCD that we use has a monochrome display with a resolution of 128*64. With the help of the GLCD, we can display custom images, icon and other characters. In this article, we will be covering how to display an image on the GLCD. So to display an image we need to configure the image accordingly. This can be done with any photo editing application such as Photoshop. Here we will be using windows built-in tool Paint.

Image Editing with Paint

First, open the image in paint.

Displaying Images and Icons on GLCD

To adjust the resolution of the image, choose Resize and select Pixels option. After disabling “Maintain aspect ratio” checkbox, set the width as 128 and height as 64. Then press ‘OK’.

Displaying Images and Icons on GLCD

Then save this image using ‘Save as’ option under file. Give an appropriate file name and choose the file type as ‘Monochrome Bitmap’. Click ‘OK’ to the warnings that may follow.

Displaying Images and Icons on GLCD

Now the 128*64 resolution Monochrome image of the required image is obtained.

Displaying Images and Icons on GLCD

Creating GLCD compatible Hex code of the image

Now run the LCD Assistant (Download) application and load the monochrome image saved in the previous step with ‘Load image’ option under ‘File’.

Displaying Images and Icons on GLCD

Now select ‘Save output’ option in ‘File’. In the ‘Save As’ window give an appropriate file name with ‘.txt’ extension.
The created text file will contain the required hex values of the image as an array.

Displaying Images and Icons on GLCD

Display Image in GLCD

To display the image in the GLCD we need to write the values in the previously created array at the appropriate locations. We need to go to the required page and column and then write the data. Here we use a character pointer ‘*bmp’ to point to the next character to print. Variables x and y are used to specify the initial location to start the display. Variables dx and dy specify the resolution of the GLCD.

Firmware Example:

The address of the array of hex values that we previously generated is then passed to the above function to obtain the image on the GLCD. Here we provide the initial position as ( 0, 0 ) and the resolution of GLCD as 128*64.

Firmware Example:

DON’T MISS OUT UPDATES!
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Subscribe, it is quick.
We hate spam too. Give it a try, you can unsubscribe anytime.
Spread the love, share this

Leave A Comment

DON’T MISS OUT UPDATES!
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Subscribe, it is quick.
We hate spam too. Give it a try, you can unsubscribe anytime.
close-link
25% OFF - OpenLabPro Course
Use Coupon: CRS25UL

 
PIC Microcontroller Primer
Want to learn indepth programming, peripheral interfacing and driver development?
close-link
Launched: IoT online Course - 25% Off when you complete your order today.
Checkout Now
close-image

Subscribe To our Email Newsletter

Be the first to get latest updates and exclusive content straight to your email inbox.
Send me Tutorials and Guides
close-link