TFT lcd not rotating to landscape

Hi everyone
i have a sketch file for a control board for a synthesizer (Si5351a) it uses a mega2560 and a 3.2" tft display
which is supposed to display in lanscape mode.
i have loaded it into the mega2560 and it only showes in portate mode.


this one is the first time i used the sketch


this on is after i chenge the tft driver

sorry forgot to say that this is a 3.5" display

hp4:
Hi everyone
i have a sketch file for a control board for a synthesizer (Si5351a) it uses a mega2560 and a 3.2" tft display
which is supposed to display in lanscape mode.
i have loaded it into the mega2560 and it only showes in portate mode.

will it help if i up the code ??


this one is the first time i used the sketch


this on is after i chenge the tft driver

sorry forgot to say that this is a 3.5" display

Go on. You have posted before !

  1. post link to the actual display that you have bought

  2. install libraries via IDE Library Manager. (note versions)

  3. run all the examples that come with the particular library.

  4. take notes.

  5. report any problems. Quote the library example by name.

Seriously. You will probably get accurate advice from (1) e.g. which library to use.

David.

Hi
yeah had a bit of a break with this covid thing

well this sketch i have has its own libraries included and i have loaded them
it all seems to work ok just that the display is not showing in landscape mode
the display is a none touch one
would it help if i load the code ?
been looking at trees all day trying to sort it lol

thanks
Howard

That is a Shield designed for Mega2560. It even has the information printed on the pcb.

Install UTFT.h library (from rinkydink)

Run the examples e.g.
C:\Users\David Prentice\Documents\Arduino\libraries\UTFT\examples\Arduino (AVR)\UTFT_Demo_480x320\UTFT_Demo_480x320.ino

Edit the constructor e.g from this:

// Remember to change the model parameter to suit your display module!
UTFT myGLCD(CTE32HR,38,39,40,41);

to this:

// Remember to change the model parameter to suit your display module!
UTFT myGLCD(ILI9486, 38, 39, 40, 41);

You will need to do the same edit on every example. Report any problems.
I am fairly certain that every example uses Landscape mode (which is the default for UTFT).

If your project needs Portrait mode:

  myGLCD.InitLCD(PORTRAIT);

Yes, there are several libraries that will run on your screen.
Personally, I would prefer a GFX-style library instead of the un-intuitive UTFT library.
e.g. Bodmer's TFT_HX8357.h library.

But this is your decision. Choose whichever library you are happiest with. (normally because the project code was written for that library)

No, I don't want to see any custom project code until you have run all the library examples successfully.

David.

hi
well the sketch uses the Bodmer's TFT_HX8357.h library and there is a user file with it
but i will try the UTFT.h library (from rinkydink)
Thanks
Howard

Well, quote the TFT_HX8357 example by name.
Paste or attach your User_Setup.h

Likewise for any UTFT example.
quote the UTFT example by name.
Paste the constructor.

David.

Hi All
Sorry that its taken long time :confused:

here is the user_setup.h file from TFT_HX8357-MASTER
hope this helps
Thanks
Howard

User_Setup.h.txt (6.56 KB)

From your User_Setup.h:

// Define ONE driver, either HX8357B, HX8357C, ILI9481 or ILI9486
//
// ##################################################################################

//#define HX8357B
//#define HX8357C
#define ILI9481
//#define ILI9486

// ##################################################################################

Your photo in #3 says ILI9486. Change the define to ILI9486.

Don't worry about inverted colours. We can fix that for you. Just say whether TFT_BLACK shows as white. Or TFT_GREEN shows as magenta. Or TFT_BLUE shows as yellow.

David.

hi
yes i have seen that, and Changed the define to ILI9486.
but i still have same problem with display not going landscape
most ot them UTFT examples worked ok and did landscape

byte multiplier;
byte Screen_rotation(1); // have tried 0 2 3 
byte Screen_negative;
byte Grey_color_correction; 
byte Syn_config;
int TFT_GREY1 = 0x8410 ;  //#define TFT_GREY1 0x8410 // New colour  // HERE WE CORRECT THE GRAY COLOR !!!!! 11 0x8410 - GREEN LABEL 0x39E7 - YELLOW LABEL
byte flag_plus_or_minus_IF;
byte number_of_channels = 9;

This is part of code from my sketch, as you can see i have tried to change Screen rotation but with no effect.

Is this the part of code i should be looking at ?

#include <TFT_HX8357.h> // Hardware-specific library
TFT_HX8357 tft = TFT_HX8357();       // Invoke custom library

Thanks for your time
Howard

Please give accurate information. e.g.

If using UTFT.h library:

  1. quote UTFT example by name.
  2. edit the constructor statement in the example
  3. copy-paste the constructor statement that you have used e.g.
UTFT myGLCD(ILI9486, 38, 39, 40, 41);

If using TFT_HX8357.h library:

  1. quote TFT_HX8357 example by name.
  2. attach your User_Setup.h file
  3. you don't need to edit the example sketches with this library.

I gave pretty detailed advice in #4.
I suggest that you stick with whichever library was used in your synthesizer (Si5351a) sketch.

If unsure, attach the original synthesizer (Si5351a) sketch. Or a link to the synthesizer (Si5351a) repository that you downloaded from.

David.

Hi
well the code is to big to put as a code so i have put it as an attachment with some other files that you might
need
Thanks again for your help so far
Howard

CAT.ino (11.6 KB)

default_settings.ino (15.5 KB)

Encoder.ino (2.66 KB)

keyboard_check.ino (27.9 KB)

Menu.ino (49.1 KB)

S_P_SWR_meter.ino (29 KB)

SI_5351.ino (871 Bytes)

Synthesizer_Mega_2560_v2_e.ino (57.6 KB)

I would be much happier with you testing library examples as I suggested in 4 and #10.
First step: we get your screen working 100%

Please add some explanation for the files you have attached.
e.g. are they all required for one project in different tabs ?

you have not attached "si5351.h" which does not appear to be supported by the Library Manager.

David.

are they all required for one project in different tabs ?

i think so but when you load up the "Synthesizer_Mega_2560_v2_e.ino" it brings up all the other files into tabs
just checked the folder and yes you need to put all files in one folder.

I have got a full landscape with UTFT_Demo_480x320 by Henning Karlsen but i have a few more to test
it seems to me that most of the TFT demos have got set rotation set as landscape but the have about half of
screen not working

Thanks again
Howard

si5351.h (11.2 KB)

si5351.cpp (30.3 KB)

Si5351Arduino-master.zip (35.6 KB)

############################################################

First off.
You should say which UTFT example you are using. What constructor. And what problem.

You should say which TFT_HX8357 example you are using. What User_Setup.h. And what problem.

if you don't want to provide this information I will not waste any more of my time.
############################################################

Synthesizer_Mega_2560_v2:

There is no "z_Free_Fonts.h"

I had to install si5321.h Rotary.h DS3231.h

The DS3231 from the Library Manager did not work.

It looks as if the Synthesizer_Mega_2560_v2 project was written for TFT_HX8357.h library.

If you have a multi-tab project you should Zip up the project. Attach the ZIP.
This gets all the tab files and saves you attaching individual files.

#######################################################

This topic was automatically closed after 79 days. New replies are no longer allowed.