Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: using uGFX in arduino, with Teensy 3.1 example

  1. #1
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    894

    using uGFX in arduino, with Teensy 3.1 example

    I managed to turn uGFX into an arduino library (well, kinda). You need five things:

    1. ugfx in your arduino libraries folder
    2. ugfx-arduino, a wrapper library that adds the necessary ugfx sources
    3. a driver library for the display you want to use, e.g. ugfx-arduino-ssd1351
    4. project-ugfx-config, a configuration library that includes the first two, and configures ugfx for your sketch.
    5. your actual sketch

    hackaday.io project: https://hackaday.io/project/8539-using-ugfx-in-arduino

    github: https://github.com/crteensy/ugfx-arduino
    The repo includes ugfx-arduino, a sample SSD1351 driver, and a sample sketch and config library.

    More display drivers can be added as individual libraries, so give it a try! uGFX ships with a lot of driver examples for common displays, see https://bitbucket.org/Tectu/ugfx/src/ -> drivers -> gdisp. As uGFX also supports audio we might even be able to get the Teensy audio board to work with this.

    This is highly experimental because it relies on arduino's library lookup mechanism to pick the correct driver and project-specific config library, but it seems to work. I've tried to confuse arduino in a quite a few ways and it didn't fail with the scheme outlined above.

    Regards

    Christoph

  2. #2
    Senior Member
    Join Date
    Feb 2015
    Posts
    162
    Sweet! Thank you Christoph! I will try to get to trying this out today and let you know how it goes!

  3. #3
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    894
    If you use the same display as I did (SSD1351) you shouldn't run into a lot of problems. If you use a different display that's supported by uGFX I might be able to help turning their driver into a working library.

  4. #4
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    894
    Some more bits and pieces:
    • Adding custom fonts works very well: you write a library and include it in your project configuration library. It can then be used just like all other fonts in ugfx. Creating a library makes it easy to share a ugfx-arduino font with others.
    • I've found a way of passing driver configuration information via structs. That's imho better than relying on arduino's library lookup mechanism when configuration is done via header files (as in #define SSD1351_PIN_RESET 14).
    • The ugfx crew say that their ILI9341 driver stub works well enough so this might be a good candidate for the next driver library. I also have that display in one of my boxes.

  5. #5
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    894
    Still compiles fine with ugfx 2.6 and teensyduino 1.30 beta 2. I'll try it with hardware (T3.1, SSD1351) later, but I'm quite confident that it will work as expected.

  6. #6
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    894
    still works. amazing, I could even make sense of my own installation instructions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •