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

Call back function does not change/redraw page? #1

Open
cryoguy opened this issue Nov 16, 2015 · 20 comments
Open

Call back function does not change/redraw page? #1

cryoguy opened this issue Nov 16, 2015 · 20 comments
Assignees

Comments

@cryoguy
Copy link

cryoguy commented Nov 16, 2015

Thanks for the wonderful efforts in creating this library! I got it sort of working with my Arduino Mega. It can compile, upload and display all the sample stetches; and, the touch screen works fine too.
img_6110
The issue I am having are following (e.g. in GuiMetroGrid): 1. although the initial panel displays without problem, page-switching call back function does not make current page invisiable and target page visible. Press Setting button does not trigger setting page, does give feedback on Serial Monitor that setting button pressed. 2. The buttons in invisible page can be touched and triggered from another page, such as the ->Home button from setting page can be activated from home page.
img_6111
3. The target page does not refresh/redraw correctly with corresponding callback function. 4. Press Menu 1 generate garbage page.
img_6109

I will keep playing with it. Any thoughts and advice?

Tony

tech.memoryimprintstudio.com

@ginge
Copy link
Owner

ginge commented Nov 16, 2015

The only thing that jumps out at me is you don't have the images on your photos. I will run some tests to see what happens if you have missing images. Might be as simple as hitting an error trap somewhere trying to deal with images that don't exist.
Thanks for taking the time to report this

@ginge
Copy link
Owner

ginge commented Nov 16, 2015

If you haven't already, ignore the above. After reading your report again i'm poking around the wrong example. D'oh.
Any chance you could let me know what screen that is and what mods you made to the lib?

@ginge
Copy link
Owner

ginge commented Nov 16, 2015

Things to try to rule out memory issues:

  1. comment out all GUi buttons apart from Settings
  2. Comment out all buttons apart from Menu 1 (this shouldn't do anything other than go grey when pressed)

@ginge
Copy link
Owner

ginge commented Nov 16, 2015

Okay last note of the day... If the above doesn't work please get latest. I have optimised quite a chunk of code away to reduce stack size.
Tested on my Teensy and Teensy LC (albeit briefly)

@cryoguy
Copy link
Author

cryoguy commented Nov 17, 2015

Thanks for your quick response. The LCD I am using is LGDP4535 documented here, http://ceezblog.info/2015/04/20/240x320-28-tft-shield-driver-4535-for-arduino/ and my blog tech.memoryimprintstudio.com. I will follow your advice and keep you posted later.

Tony

@cryoguy
Copy link
Author

cryoguy commented Nov 17, 2015

If I comment all buttons except Menu 1 or Settings, I only got print output from Serial Monitor. There's no behaivor change of the button upon pressing. It should go grey when pressed? I will take a look at your new code, and keep you posted.

Thanks.

Tony

@cryoguy
Copy link
Author

cryoguy commented Nov 17, 2015

Ok, Here is what happened with your updated code. I can compile and upload GuiMetro example as before without any issue. Most of previous issues remains. Press Setting button does not trigger new page, A few press on Menu1 will trigger a barbage display. -->Home can be pressed from main page. The only differnce I noticed now is that, the -->Home button (never visible though) is capable of bringing back partial display (see image below). Prior to today's update, there is only one strip in the center.
img_6113

Any more advice?

Thanks again.

Tony

@cryoguy
Copy link
Author

cryoguy commented Nov 17, 2015

One thing to clarify, the Settings can be triggered by pressing Settings button, but it is just remain invisible. It renders -->Home back touchable. Tony

@cryoguy
Copy link
Author

cryoguy commented Nov 17, 2015

So I guess 3 questions remain. 1. The setting page does not redraw. 2. Mutliple press on Menu 1 will generate a garbage display. 3. Home button triggers a partial display.

@ginge
Copy link
Owner

ginge commented Nov 20, 2015

I don't know how long you can wait for a fix on this, but it looks like I need to order an arduino mega to work this one out.

Hopefully you can bear with me

@cryoguy
Copy link
Author

cryoguy commented Nov 21, 2015

Hello Barry,

Thank you for your help and your wonderful work. That will be great if you can spend some
efforts to fix your library for Arduio Mega. Your library is truly one
of kind, and it is the simplest and most elegant way to implement menu in my
opinion. Let me know if there is anything else I can try or test.

Best!

Tony

@ginge
Copy link
Owner

ginge commented Nov 21, 2015

Short: I replicated your setup with no issues noted.
I went out today and purchased an Arduino Mega 2560 R3 and the same screen you have. after changing the pins to suit the Mega, it works without issue.
Can you upload your code, the GFX library and the ILI9341 library with it please so I can check your code as is is

@cryoguy
Copy link
Author

cryoguy commented Nov 22, 2015

Can you pass me the info of the LCD you are using with Mega R3? The one I am using is a cheap LGDP4535 (I can mail you one if you want) and I have to use a modified library to make it work (http://tech.memoryimprintstudio.com/arduino-with-a-lgdp4535-tft-lcd-touch-screen/). I have to use SD library with softSPI for mega in order to access SD card, but does not work with library at the moment. As you can see, I also have to modify your library to make it display ok. Another thing I did is to

use attached zTouchScreen to rotate tft 90 to match LCD coordinate.

Thank you so much for all your efforts. I will email you the code since tar file is not allowed here.

Tony

@cryoguy
Copy link
Author

cryoguy commented Nov 22, 2015

@ginge
Copy link
Owner

ginge commented Nov 22, 2015

thanks for this. I also found ceez blog where you discuss this.
I am actually using ILI9341 devices, not the tft you use.
There does seem to be something strange going on inside of the driver you use, possibly related to screen blanking and redraw methods. I will put together a test ino to see what capabilities are of the tft using only adafruit GFX library.
I have ordered a 4535 based device. I'll be poking around in your code until it arrives

@ginge ginge self-assigned this Nov 22, 2015
@ginge
Copy link
Owner

ginge commented Nov 24, 2015

Damnit it arrived and it looks like the display was swapped to an ILI9341. I'm UK based, If I can order one cheaper than wherever you are likely to send me yours from, It is preferred.

@cryoguy
Copy link
Author

cryoguy commented Nov 25, 2015

Can you order this from amazon in UK? if not, I will send you one from US. http://www.amazon.com/gp/product/B00UAA2XIC?psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00

Thanks.

Tony

@cryoguy
Copy link
Author

cryoguy commented Nov 30, 2015

Barry,
Can you pass me the link to the ILI9341LCD you are using? I want to order one and give it a try. Thanks.

Tony

@ginge
Copy link
Owner

ginge commented Nov 30, 2015

As I'm struggling to get the board you are using, that's a good idea.

The one you see in the video is this:
https://www.adafruit.com/products/1770

And I also have
http://www.amazon.co.uk/Generic-Touch-Screen-Card-Socket/dp/B00K0F2QR0/ref=cm_rdp_product

The second one needs slightly different pinout config to the default I have
in Git.

If you buy a shield, make sure it has the 6 in SPI header. It will make it
so much easier for you.

On 30 November 2015 at 22:44, cryoguy [email protected] wrote:

Barry,
Can you pass me the link to the ILI9341LCD you are using? I want to order
one and give it a try. Thanks.

Tony


Reply to this email directly or view it on GitHub
#1 (comment).

@zadehalex
Copy link

zadehalex commented Oct 19, 2016

I seem find the root cause.

  1. I use arduino uno and tftlcd
    https://item.taobao.com/item.htm?spm=a1z09.2.0.0.ttFCCf&id=520975390170&_u=j26t1qu6c033
    <-- ( I don't know why the link can't connect, please copy url to link )

  2. I use Adafruit_TFTLCD library and modify some code to meet the TFTLCD (ili9328 or ili9325),
    after upload the example, I have the same problem like above.

  3. Finally I find A2,A3 pins is sharing by LCD and Touch Screen,
    so modify the Gui.cpp -> void Gui::update(void)
    As-is:
    TSPoint p = ts->getPoint();

    To-be:
    TSPoint p = ts->getPoint();
    pinMode(A2, OUTPUT);//XM
    pinMode(A3, OUTPUT);//YP

  4. Then everything is ok!

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