Close

Let's start with their example sketch

A project log for using uGFX in Arduino

uGFX was written for use with makefiles. Using it in arduino is possible with minimal effort, though. Here's how.

christophChristoph 11/23/2015 at 15:580 Comments

The uGFX maintainers have created some simple instructions how to use uGFX with Arduino.

Heading to ugfx/boards/base/ArduinoTinyScreen (in the repo), these are the instructions:

This is a working Arduino project for the TinyScreen ATmega board.

To use this with the Arduino IDE Development Environment follow these steps...

1/ Copy the gfx directory from this directory to your Arduino library. eg /Arduino/libraries/gfx
3/ Create a subdirectory under "gfx" called "ugfx" and copy the entire ugfx system to that directory.
4/ In the "gfx" directory adjust the gfxconf.h for your project.
5/ In the gfx directory create a .c file for each driver that you want to use that contains a single line
	to #include the driver source in the repository file. For a GDISP driver you will also need to create
	a gdisp_lld_config.h file that contains a single line that #include's the gdisp_lld_config.h file for
	the GDISP driver. Don't forget to add the board files for your drivers.
	This example has the files for the SSD1331 TinyScreen display.
6/ Copy the example ugfx_test.ino file to your Arduino projects directory eg /Arduino/ugfx_test
7/ Modify the ugfx_test.ino project to suit.
8/ Remember that for ATmega platforms RAM and FLASH are very limited. Be careful which ugfx options you turn on.
	Arduino ARM based boards are much less limited.

Basically it is suggested to add ugfx as a library and configure it for your project. The main problem here is that one might have several projects using uGFX, and altering the library for every project will break all others. That's bad.

Furthermore it is suggested to add the low level driver files to the sketch main directory, which isn't really neat. There should be a cleaner way of doing this.

I decided to tackle the first problem first, as it is by far more important.

Discussions