Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adafruit_GFX + Adafruit_ILI9341 + uGUI not work #24

Open
Tungsteno74 opened this issue Dec 19, 2016 · 2 comments
Open

Adafruit_GFX + Adafruit_ILI9341 + uGUI not work #24

Tungsteno74 opened this issue Dec 19, 2016 · 2 comments

Comments

@Tungsteno74
Copy link

Tungsteno74 commented Dec 19, 2016

Hello guys!

First of all many tanks to @achimdoebler , this is a very time saver library!

The only big problem (in my case) is that i'm trying to use it together with Arduino Adafruit_GFX and a modified version of Adafruit_ILI9341 libraries but, after compiling and uploading on my Arduino Uno with 2.4 tft lcd shield (8bit bus and 18bit colors) , what appears is a randomly colored pixels on the screen.

All examples on the Adafruit libraries work well so, i think i'm doing something wrong with the implementation of the uGUI lib.

My code is as following:
In my EXAMPLE i modified the ugui_config.h and i've included all relevant code in guitest.ino.
Then, in the UGUI.h file i replaced #include <system.h> with #include <Arduino.h>.

Someone has already tried to run the library with Arduino?
In that case you could post your implementation code?

Many thanks.

@Tungsteno74 Tungsteno74 changed the title Adafruit_CFX + Adafruit_ILI9341 + uGUI not working Adafruit_CFX + Adafruit_ILI9341 + uGUI not work Dec 19, 2016
@Tungsteno74 Tungsteno74 changed the title Adafruit_CFX + Adafruit_ILI9341 + uGUI not work Adafruit_GFX + Adafruit_ILI9341 + uGUI not work Dec 19, 2016
@sealj553
Copy link

sealj553 commented Jul 4, 2017

Hi, I'm in a similar situation. I'm using an arduino project with a STM32f103 (STMduino) using an ILI9341 with the Adafruit library.

I think your problem may be due to the different pixel formats. uGUI uses RGB888 while the adafruit library uses RGB565. In your pixel setting function, you need to convert to the correct pixel format. Here's my function:

void SetPixel(UG_S16 x, UG_S16 y, UG_COLOR c) {
  tft.drawPixel(x, y, 
        (((c >> 19) & 0x1f) << 11) |
        (((c >> 10) & 0x3f) <<  6) |
        (((c >>  3) & 0x1f)));
}

With this conversion, my colors are correct, but I cannot get any windows to display correctly.

@rtwfroody
Copy link

FWIW, was also trying to get this to work. I can get UGUI to correctly display a window with a textbox in it, but only if I tell it the resolution is smaller than it really easy (eg. 300x200 instead of 320x240). If I tell it the actual resolution, then my program crashes shortly after UG_Update() is called. It feels like memory corruption somewhere, but I can't figure out what might be going on.

When I pass the 300x200 and register a driver for FILL_FRAME, my window is drawn (faster), but the textbox doesn't show up and the program appears to crash there.

My hardware is the Adafruit Feather Huzzah, along with the ILI9341-based 2.4" Touchscreen Feather Wing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants