Open Source GUI module
for embedded systems


Date Event
13.9.15 Forum added for discussions 🙂
22.3.15 µGUI is now available on GitHub: https://github.com/achimdoebler/UGUI

What is μGUI

µGUI is a free and open source graphic library for embedded systems. It is platform-independent and can be easily ported to almost any microcontroller system. As long as the display is capable of showing graphics, µGUI is not restricted to a certain display technology. Therefore, display technologies such as LCD, TFT, E-Paper, LED or OLED are supported. The whole module consists of two files: ugui.c and ugui.h.

μGUI Features

  • μGUI supports any color, grayscale or monochrome display
  • μGUI supports any display resolution
  • μGUI supports multiple different displays
  • μGUI supports any touch screen technology (e.g. AR, PCAP)
  • μGUI supports windows and objects (e.g. button, textbox)
  • 16 different fonts available
  • integrated and free scalable system console
  • basic geometric functions (e.g. line, circle, frame etc.)
  • can be easily ported to almost any microcontroller system
  • no risky dynamic memory allocation required

μGUI Requirements
μGUI is platform-independent, so there is no need to use a certain embedded
system. In order to use μGUI, only two requirements are necessary:

  • a C-function which is able to control pixels of the target display.
  • integer types for the target platform have to be adjusted in ugui.h.

Example Projects
Various example projects can be found on my YouTube channel:

ToDo List
The following features are on my ToDo list:

  • Demo files for different platforms
  • Mouse support
  • Touchscreen support
  • Window support
  • Objects
  • Multi-Layer support
  • Support for hardware acceleration
  • Alpha channel support
  • Anti-Aliasing
  • Center String function


I've spent a lot of time writing µGUI. If you like this project, please support it!

Feel free to…

  • report bugs
  • send suggestions for upcoming features
  • share µGUI
  • send me pictures of your application using µGUI
  • help me to keep this project alive: Donate 1€




Reference Guide

Download 2.10 MB 13943 downloads


Latest version:

µGUI v0.3

Download 650.26 KB 8598 downloads

Older versions:

µGUI v0.2

Download 319.80 KB 1689 downloads

µGUI v0.1

Download 211.61 KB 928 downloads


Example Projects

STM32F429 Discovery

Download 601.49 KB 9417 downloads


Companies Using µGUI

84 thoughts on “µGUI

  1. Hello, 

    Seems interesting UGUI. However for example for the controller ST7586S have any examples of LCD functions to associate with UGUI? If you have made and canst send to me … 

    Vitor Aquino

    • Hi Vitor,

      I hope this helps!

      //#define H_BYTE_CNT      80       // 240×160
      #define H_BYTE_CNT      43       // 128×160

      unsigned char display_buff[H_BYTE_CNT*160];

      void st7586s_pset(UG_S16 x, UG_S16 y, UG_COLOR c)
         unsigned int pos;
         unsigned char b;

         switch( x%3 )
            case 2: b = 0x03; break;
            case 1: b = 0x81; break;
            case 0: b = 0xC0; break;

         pos = (x / 3) + y * H_BYTE_CNT;

         if ( !c )
            display_buff[ pos ] |= b;
            display_buff[ pos ] &= ~b;

      void st7586s_update(void)
         unsigned int i;
         send_cmd( 0x2C );
         for(i=0; i
            send_data( display_buff[i] );

      • Hello,

        Thanks for the extensive library. I see you already used a ST7586S in one of your videos demonstrations. I have a similar display but it draws 2 pixel per byte and not 3 pixel as the datasheet . Can you help me with this ? below is the initialization code i used

            // Display OFF
            GLCD_Command( 0x28);
            // Delay 50 ms
            //currentTime = G_SystemTime1ms;
            //while(!(IsTimeUp(&currentTime, 50)));
            // Vop = B9h
            // BIAS = 1/14
            // Booster = x8
            // Enable Analog Circuit
            // N-Line = 0
            // Monochrome Mode
            // Enable DDRAM Interface
            // Scan Direction Setting
            GLCD_Data(0x00);       //COM:C160–C1   SEG: SEG384-SEG1
            // Duty Setting
        //    // Partial Display
        //    #ifdef PARTIAL_DISP
        //    GLCD_Command(0xB40);
        //    GLCD_Data(A0);
        //    GLCD_Command(0x30); // Partial Display Area = COM0 ~ COM119
        //    GLCD_DATA(0x00);
        //    GLCD_DATA(0x00);
        //    GLCD_Data(0x00);
        //    GLCD_Data(0x77);
        //    #endif
            // Display Inversion 
            GLCD_Command(0x20); // OFF
            // Column Address Setting
            GLCD_Data(0x00); // SEG0 -> SEG384
            // Row Address Setting
            GLCD_Data(0x00); // COM0 -> COM160

        • Hi Mesbah,

          I’m quite sure that there is something wrong with your mapping.

          Have you selected monochrome mode or grayscale mode?

          Maybe page 18/19 of the datasheet helps you?

          Which display do you use?



          • Hi Andrey, yes! In order to use this feature you have to use a “read – modify – write” pset function which reads data from the display, changes it and writes it back to the display. BR Achim

    • Hi Jack,

      µGUI does not officially support Arduino so far.

      To be honest: I presume that it runs on Arduino without any problem, but I have not tested it 🙂

      I’ll keep you updated regarding Arduino-related examples.



  2. Can you provide code for the dsPic33 with the SSD1322 driver?  That is the exact setup I am trying to run for a project of mine.  I am using the Blue Display.  Thank you so much!!!!

      • As we're already talking Microchip, what would be necessary to get a Pic32MZ2048ECH144 and HX8238-A based display to use µGUI?

        • First of all you have to connect the TFT DPI Interface to the PIC. Then initialize the internal DPI Interface of the PIC. After that you only have to write a Pset-function to use uGUI. Hope this helps! By the way: which hardware platform do you use? BR Achim

  3. Thanks for posting this.

    I really like the design of your code. I was able to get it up and running on a PSOC5 with no problems on a 128×64 newhaven display in so little time I was surprised!

    Have you thought about how to implement screen rotation? I am wondering how to change to portrait from landscape on my display (at compile time, not run time)
    thanks, Cris

    • Hi Cris,

      thanks for the commendation!

      It is very easy to realize screen rotation:



      Your display has 128×64 pixels, right?

      Just pretend it has 64×128, use UG_Init(…64,128…) and you get a rotation by 90 degree. Of course you have to swap x and y INSIDE your pset function.

      Flip the screen:

      In order to flip the screen horizontally and/or vertically just use the following trick at the beginning of your pset function:

      x = 127 – x; // Flip the screen horizontally

      y = 63 – y; // Flip the screen vertically






  4. Hello Achim,

    I was wondering if you could please provide some example code interfacing with the Raspberry Pi and 1.5" OLED – SSD1351.


    • Hi Paul, unfortunately I don’t have such example code. Maybe I can help you to write your own implementation? BR Achim

      • Hi!

        I'm also interested in getting a 1.5" OLED SSD1351 running on a Raspberry Pi 2 Model B. In fact, I want to run 3 displays from that Pi (without exhausting the GPIO either–it'll be running 3 sensors too).

        I have some resources where I work, but any other help you can give would be much appreciated!


        • Hi Spencer!
          Interesting project – please share some more details on the forum!
          I would use SPI for all OLEDs. µGUI is ideally suited to handle all of them in parallel!
          At the forum you will find an example for the SSD1351!
          BR, Achim

  5. Hello,

    At first i would like to congratulate you for this great library/project. I tested it in the STM32F429 Discovery and liked a lot. So, I would ask if you are interested in creating an adaptation layer for an event manager based on RTOS services. I beleive that through RTOS semaphores, queues and timers it is possible to better manage the CPU resources. I started myself a GUI event handler, as you can see here:


    The code is available here:


    However, i´m not a great GUI designer. I just have a RTOS project and i would like to disseminate the use of such a great tool for embedded software development. Even, i developed a demo based in your code using RTOS services. Doing that i realized a excessive CPU usage for the touch screen reading (like 10%). I just raised the I2C clock to 250khz, droping the CPU usage for less than 1%.

    If you are interested, i can send you my modified project in order to you evaluate if its possible to implement such event handler mechanism.

    I wish you all the best,

    Best regards,

    Gustavo Denardin

  6. Hello Achim,

    Nice work with the library.

    I see on the youtube channel that you used it with 7 inch tft (both uGUI and STemWin). Is there a chance to share the source code ?

    I've got a problem with the refresh rate. Some times a flicker line appear on the middle of the screen. The flicker will occurs rarely if I lower the PCLK to 16MHz, but it still appears.



  7. First, I want to thank you for this library. I've used 0.2 version successfully with an OLED with SSD1322 controller on PIC32. Are the window and button functions work on OLED? I haven't had success with the example code.

    • Hi Andre,

      yes, µGUI v0.3 works perfectly fine on OLEDs!

      Could you share some pictures and your source code on the forum?

      BR, Achim

  8. void UG_WaitForUpdate( void )
       gui->state |= UG_SATUS_WAIT_FOR_UPDATE;
       while ( (volatile UG_U8)gui->state & UG_SATUS_WAIT_FOR_UPDATE )
                if(gui->touch.state == 1)

  9. Hi  Achim,
    before everything i want to thank you so much for the outstanding library!

    I'm using an "ER-TFT070-4" from BuyDisplay 7" with OTA7001A Driver, no init code, just a DPI interface to be used with LTDC interface.
    Starting with your example of uGFX 3.0 on Stm32f429-Discovery (embd LCD removed) i have changed only screen dimensions to the ltdc.h in order to make it all work and so on it's a really good result.


    #define  THS                     10
    #define  THB                     20
    #define  THD                     800
    #define  THF                     10
    #define  TVS                     2
    #define  TVB                     2
    #define  TVD                     480
    #define  TVF                     4


    The problem is that i don't understand what THB, THS, THF, TVS, TVB, TVF means and what i have to use in order to optimize a little bit my code.. can you suggest me about that, or maybe a "programmers note" where it's all explained? 
    Thank you so much, and sorry but i'm nearly new to program things with this complexity.


    PS. if you want i can send you my entire project, i'm aslo using Coocox IDE!!

    • Hi Davide, I’m glad that you like uGUI 🙂
      Yes, please send me the project. I’ll reply with some informations regarding DPI. Best regards, Achim

  10. Hi Achim,

    I am from Taiwan.

    I am a college student.

    So,My English is poor.sorry.

    Your Library is my best tutorial.  Thank you.

    I have some question about images.

    1.If i want to use an images for  a button.

    How could i do?


    2.Can i put an images on the button?? 

    • Hi Chen,

      I’m glad that you like µGUI.

      Unfortunately pictures inside buttons are not supported by µGUI v0.3 🙁

      µGUI v0.4 will be able to do that!

      BR, Achim

  11. Hi


    Very nice project!


    I am having trouble setting the STM32F429 (discovery) to use a larger display.

    Can you please send me your initialization code of your 800×480 display?



  12. Hi. This looks very nice

    I see you have a driver for the 1.54 OLED SSD1305Z 126×64 Mono as per your UTube demo

    Would you mind sharing the Init Driver commands for this display So I can try out your Library




  13. Hello Achim
    Can I use ugui with STM32F4-Discovery + ssd1963 fsmc module? I have ssd1963 library. I can run the screen but do not know how I could combine seamlessly with ugui. Can you help with this?

  14. Can you provide code for the MSP430 with the SSD1322 driver? I can't understand how can i use your library. Pleas help me!

  15. Pingback: [General] Free or low cost GUI Development Software

  16. Hi there i am after a oled display for a pure evoke flow radio and have been told it is a       pmo 19301 and is 2.7" diagonaly my question is do you know where i can buy one of these units.

    Regards Phil


  17. Hi Achim

    Nice job on the uGUI! I'm currently experimenting with it, I had an stm32f429 discovery board so could start right away with your example project in CoIDE.

    I drew a window because I need some buttons. However I also need some rectangles so I drew 2 of them with the intention to draw them on top of my main window. This clearly does not work… What I try to do is have 2  measured values shown in those rectangles (voltage and current), all on top of the window.

    So I need a window, with buttons to push but also 2 areas on the window to show some measured values. Can you give me a hint how to do it or do you have somewhere an example?



    • Hi Dennis,

      you could use a textbox and UG_TextboxSetText() function.

      I hope this helps. Please post further questions on the forum.

      BR, Achim

  18. Hi

    I was wondering if I can use this library to get SSD1322 work with xmegaA3AU ? Can you help with some sample code, that would be great! Looking forward to your reply.


    • Hi Shree,

      I have added a example pset function for the SSD1322 driver on my forum!

      Please use a correct initialization sequence for your display!



  19. Dear Sir,

    We are using Tiny6410 stamp module. It is restricted to using only friendlyarm display. We need to interface resistive touchscreen display of 5 inch & 7 inch of our choice. Please give steps how we can use your library.

    Thank you.

  20. Hi achim,

    i really wonder about  your gui. it is very simple to use. i want to draw a image on my lcd. i also done by using your library with given example image. now i want to convert image to header file. can you suggest any software to do  that.

    • Hi Arun, I think there is a conversion utility on the ST microelectronics page. I can’t remember the name, but I’m sure there is one. BR Achim

  21. Hi  Achim,

    I have a small display with no touchscreen. However I want to use windows with GUI buttons and use up/down buttons (physical buttons) to select GUI buttons on the screen (and use an enter button to simulate pressing a GUI button). Is it possible to do this with ugui, to select GUI buttons and generate GUI button clicks programmatically without toutchscreen?



    • Hi Jan, yes this is possible. Just implement a fake touch function, which returns coordinates which are inside the area of a button. That’s it 🙂
      BR Achim

    • Hi, yes I’m going to write an example for the STM32F7. Unfortunately I’m very busy right now, so please be patient…

  22. hello! thanks for the hardwork! 😀

    well, this is my first time using STM. i'm using stm32f407 by the way. i really want to use ugui with my stm and ssd1289. do you have any project example that i can use as refrence? it would be really helpful. thanks!

  23. Dear Sir

    I need to use your UGUI with ATMEGA AVR & 7" ER-TFT070-4 TFT LCD in 16it parallel mode.

    Kindly share any example so that i can use your Ugui with my compiler. I am using CodevisionAVR.

    Thanks for your cooperation.



    • Hi Ahmed, currently I don’t have any example for Codevision. Please have a look at my example projects. It should be quite easy to port them to your platform. BR Achim

  24. Hi Achim!

    Super nice library. It's very well coded and easy to use. I've began developing on it a couple of days ago and will probably go with your library for the rest of my project.

    I've noticed that drawing bitmaps could easily be accerelerated with a hardware driver for controllers like the SEPS525:

    1) Prepare peripherals for data transfer.

    2) Setup X start, Y start, X end and Y end according to the bitmap size and position.

    3) Use a pointer to the bitmap array and increment the pointer after each color sent.

    This allows you to write the whole bitmap in one shot with all the right colors (you don't have to write it pixel by pixel).

    With this in mind, I believe it would be fairly easy to add a supported hardware driver to be used by the drapBMP() function.


    • Hi Jonathan.
      thank you very much for the feedback! Good idea! There will be some more new acceleration functions available in 0.4…Please post your project at the forum!
      BR Achim

  25. Hi!

    First of all – great job!

    And thank you for making it free 🙂

    I've set it up on an STM32L100RCT6 with an 128×64 glcd, and everything works like a charm, except the UG_DrawLine() function, which seems to always draw a falling line, no matter how the arguments are arranged 🙁

    UG_DrawLine(10,60,120,20,C_BLACK);  //falling line 60->20
    UG_DrawLine(10,10,120,50,C_BLACK);  //rising line 10->50 (but is falling)

    produces two prallel lines, while they should intersect.
    Is there something I'm doing wrong, or it just doesn't work this way?
    Best Regards, and thank you in advance.



    • Hi Krzysztof, thanks for the feedback. I’m glad that you like ugui. Please post your source code on the forum. I will have a look at it. In general it should work! Best regards, Achim

  26. Hi.

    Any chance this could be ported to the Teensy (3.2) with the ILI9341?

    I could probably give it a go to see if I can get it working, but unsure how to do this exaclty as it's a bit out reach for me at the moment.

    Looks awesome!

    Good work 😀

Leave a Reply

Your email address will not be published. Required fields are marked *