Graphic LCD display ST7565R – Menu

What would a graphic display be without a menu? A lot of times, when you are creating some device which is utilizing LCD display you need a menu which will help you to navigate through the device functions. I would like to show a few ways how to create such menu on LCD with ST7565R driver.
In the beginning, we can try to write the menu by ourselves. I learned it the hard way that it isn’t as simple as it seems to be. In addition, I am not a programming wizard, so for more skilled person than I am it may not be a problem to write such menu. Nevertheless I wrote something, it is not a masterpiece, but I would like to share my work, because someone may find it useful. As usual, I used well-known library U8glib, ATmega328p microcontroller and rotary encoder to navigate through the menu. I divided my program into few parts and below I’m going to present a file with the main function. Nonetheless, you can download the whole project at the end of the post.

Writing your own menu from the scratch has its benefits. As a creator, we can build our menu according to our needs and fitted to our project. If I had worked on this a little longer maybe I would have created something better. Here are the visual effects of my work.


If you’re not keen on writing your own code you may use read-made solutions. I stumbled upon a library larded with multiple functions to build your own menu. M2tklib library is created to work with graphic libraries and it allows you to write an elaborate menu in a simple way. One of the graphic libraries the m2tklib is working with is U8glib. The author of the library added a bunch of examples presenting the possibilities of the library and created a short tutorial on how to use it with full documentation, which is available on the library Internet site. Apart from the functions which allow you to create your own menu, it handles switches and rotary encoders. The library is worth trying, because it offers quite a lot of possibilities. At the end I would like to present you a code of a menu created with m2tklib, which was created with a huge help of examples delivered with the library. Unfortunately, both libraries are taking up quite a lot of microcontroller’s memory. This tiny example takes up as much as 63.2% of ATmega328p memory, while my program takes up only 22.7%.

Below there’s a gallery of a compiled, working code.




Załączniki Wielkość
Moje menu Atmel Studio 6.2 2,32MB
Moje menu Eclipse AVR 2,16MB
M2tklib Atmel Studio 6.2 3,08MB
M2tklib Eclipse AVR 3MB


Graphic LCD display ST7565R – Menu
Ocena: 5 (2 głosów)

No Comments

Comments are closed.


This site uses cookies to store information on your computer. Click for more details

Our site uses cookies to personalise site content and advertisement, to offer social network functions and to analyse traffic on our website. Information we gather about using our website are shared with our social media, advertisement and analytical partners. You can find more info on How Google uses data when you use our partners' sites or apps.