Different Screen To Example, With Different Parameters

So here I am with 1 week left to complete my Arduino assessment with everything paid, built and the code is done, only to find that the TFT Lcd screen has different parameters for the board. The issue I imagine is relatively simple, but with my knowledge quite complex. the issue lies with this pair of code.

//==== Creating Objects
UTFT    myGLCD(SSD1289,38,39,40,41); //Parameters should be adjusted to your Display/Schield model
URTouch  myTouch( 6, 5, 4, 3, 2);

The example used, uses this shield http://www.dx.com/p/lcd-tft01-mega-shield-v2-0-adapter-module-white-200503?utm_rid=28296997&utm_source=sas#.WWcS64h942x

The shield I have, which includes the screen built in is this 3.2" TFT LCD Touch Screen Expansion Shield With Touch Pen For Arduino 9cm for sale online | eBay

As you can see the inputs are quite different, resulting in the need for different parameters, that I do not know nor can figure out due to my understanding.

I am pressed for time and would greatly appreciate the assistance in quickly resolving this issue :slight_smile:
Thank you in advance! :smiley:

Your Adapter shield is for 40-pin 3.3V displays. It only fits on a Mega or Due.

Your Display shield plugs straight into a Uno, Mega, Due, ...
I do not know if the makers have hacked the UTFT library to support this Shield.

Your display is supported by the MCUFRIEND_kbv library but you must do some edits. e.g.

I have no idea what 240x400 controller is mounted on your Shield. It might be SPFD5420 or ILI9326 which need:
#define SUPPORT_9326_5420

Read the mcufriend_how_to.txt

If your project code has been written for an SSD1289 240x320 controller using UTFT, you need to use Adafruit_GFX style methods instead. Ask for help.


I have downloaded and added MCUFRIEND_kbv, Adafruit_GFX and TouchScreen library. I could not get any of the examples going but did manage to upload them only to have a white screen. I'm also not 100% sure how to add the #define, etc correctly. I will attempt to post my project, so the scale of the code is more greatly understood.

the bird c file must be added to "IT WORKED" for the example to work

bird01.c (9.59 KB)

IT_WORKED_.ino (16.2 KB)

I have downloaded and added MCUFRIEND_kbv, Adafruit_GFX and TouchScreen library. I could not get any of the examples going but did manage to upload them only to have a white screen. I'm also not 100% sure how to add the #define, etc correctly. I will attempt to post my project, so the scale of the code is more greatly understood.

You have chosen to buy a different screen. There is a lot of work involved.
I have suggested that you try MCUFRIEND_kbv and told you that you have to do some defines.
Read the mcufriend_how_to.txt to see how to do this.

There is no way that a student can convert your program AND write your own "Arduino assessment" in 6 days.

I can't believe that any school would give this to a student. I am sure that they have given you a more straightforward project.

If this program is an independent hobby project, I will convert it for you.
If it is an official school "assignment", you have to do the work yourself. Ask specific questions. I will answer them.


Sorry about the miswording of assessment... This project is for an independent hobby, as well as an introduction of touch screens. Also, I will add that the "due" date is when I am leaving for vacation, if I don't set due dates things to tend to take, well all year.

If you could convert it for me that would be amazing, as it will teach me the differences by comparison between MCUFRIEND and UTFT (my small knowledge is only UTFT) which will enable myself to much more easily convert in the future

I think if you are realy pressed for time, you do not buy on dx.com ...
If you can wait several week for economical reason, this is not a reason for your brain's economy ...
You can wait also many days to have solution for your problem !
Isn't it ?

Hey mybrain_iq55
I buy locally but in this case, due to budget, the screen was cheapest from Ebay. If I were to buy another screen, I think it would be a waste of money and sadly it would take too long to arrive as I live in Australia.

dear aperson,

You appear to have an Open-Smart 3.2 Shield. Open-Smart seem to provide a hacked version of my library.

Your "bird" sketch does not work. There are MASSIVE inconsistencies.

I suggest that you start with something that is proven. (using UTFT, Adafruit, MCUFRIEND_kbv, ... )
Then we can probably help you to get it running on your hardware.

Be honest about school or hobby. People will help.

It is not wise to just buy the cheapest from Ebay. However the "cheap" items often have third party support.
For a school project, Adafruit is safer. They sell good items AND provide supporting libraries, documentation.


Hey David
How did you find out it was an open smart shield? I did not know how dodgy this shield was and how you feel about the company having a hacked version of your library, very sorry about that.

With the bird sketch, it does not work unless you add the bird01.c file, it should look like another tab when you add it.

I did have a school assessment which is the reason why I got into Arduino, that was due 3 weeks ago (it's holidays now) I handed in a float switch alarm, after failing the LCD controlled float switch alarm, which is why I am attempting to do something with the screen now. However, if not even you can get it going, it will simply have to be put aside for now, until I can afford a proper screen. What would you recommend for a beginner MCUFRIEND or UTFT?

I already asked the seller if they had any libraries, they have nothing. the thing I'm mostly concerned about when shopping for things imported is solely the shipping cost, from China it's actually cheap if not free, and only takes 2 weeks. America I have paid $80 and waited 4-5 weeks

Your original post #0 shows that it is an Open-Smart shield.

It is a perfectly good design. I am happy to support it.
I would have been happier if OpenSmart had actually asked me.
Then they could tell me which controllers they are actually using, and I would make sure that they are enabled by default.

Regarding your bird sketch. A clean build is one thing. Running on real life hardware is the important test.

Receiving packets from China is 10-20 days for the UK.
You probably get them faster to Australia.

Anything can go wrong. Whether from China or the US. If something is important, buying from a local Distributor is quicker and more reliable but you pay for the service.


Hey David. I've abandoned the original code, but I'm determined to see the screen do something. If you do, by any chance could you provide me with a code that works? I've managed to pack the screen and board but nothing else.

I have tried to use the examples with the library but sadly could not get any working, all that appears is a blank white screen with the occasional flash.
Again thank you for your help, I really appreciate you taking the time.

You have bought an Open-Smart Shield. It should work just fine.
Either with their hacked libraries or with my library (when you enable the appropriate SPECIAL)

I provide library examples. Open-Smart provide examples.
Most Adafruit_TFTLCD examples should work too.

In fact most "Adafruit_GFX" style programs should require minimal changes. e.g. the include and constructor.

Your "bird" program was complete pants. If you want help with a real program, members will probably help you.

First off, you must make some effort yourself e.g. identify which controller you have e.g. ILI9326, ILI9327
e.g. quote which examples you have working.

Your link has this photo which implies ILI9327:


Something finally worked! I ended up going for the open-smart examples, as I figured they would be easier due to my board.


However, a few minor problems have popped up. The background of the screen on mine is white whilst on the video example its black, not a major issue but I don't understand why that is. my main concern the examples seem to be too large for my screen and do not fit.

Also, the first example contains the sliding colours but after that not any of the fancy animations, the code hasn't been changed, why is this?

All errors aside, thank you for the help, i wouldn't of got this far without you :slight_smile:

I explained how to use MCUFRIEND_kbv in #1.

I posted a photo in #12. Does this match your screen?

It does not take too much time or effort to answer specific questions.
If you answer accurately, your problems can probably get resolved within minutes.

I have just viewed the video on GoogleDrive. If your screen is different, note the time of every problem.
Then I can compare your "problem" with the particular timeslot in the video.