Close

Creating a (kinda useless) bare uGFX library

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 16:210 Comments

Most parts of uGFX include "gfx.h", so we need to have this available. The only way to trick Arduino into adding an include path (as far as I know) is to create a library. A bare uGFX library can be created by creating a clone in the library folder, like this:

~/Arduino/libraries$ git clone https://bitbucket.org/Tectu/ugfx.git
Firing up arduino and opening the library manger shows the library:

Good. Including the library in a sketch through the "Sketch->Include Library" menu adds all include files from the library's base directory:

#include <pffconf.h>
#include <gfxconf.example.h>
#include <gfx.h>
#include <ffconf.h>
#include <mf_scaledfont.h>
#include <mf_rlefont.h>
#include <mf_bwfont.h>
We just need <gfx.h>, but as far as I can tell the others don't hurt. But there's no gfxconf.h and also no project-specific low level drivers. We can't add these to the main sketch directory, because Arduino doesn't add it to the compiler's include path. So we need a ugfx config library for our project.

Discussions