help : mega 2560 & 3.5" Tft display

I have been playing around with arduino for about 3 months now.
recently i bought this 3.5" Lcd display since i was getting it cheap.

i can't find an appropriate library for the model. I have downloaded the libraries from multiple sites but now of them seem to work for my model which is supposedly CTE35.
I figure out the model when i went through the demo code i got from the manufacturer website.
somebody please help me get started with this.. it'll be very much appreciated..

the library link is : Electronics - Henning Karlsen
& following is the demo code

#include <[color=#CC6600]UTFT[/color].h>

extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];


[color=#CC6600]UTFT[/color] myGLCD(CTE35,38,39,40,41);   [color=#7E7E7E]// Remember to change the model parameter to suit your display module![/color]


[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
  myGLCD.[color=#CC6600]InitLCD[/color]();

  myGLCD.[color=#CC6600]clrScr[/color]();
}

[color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]()
{
  myGLCD.[color=#CC6600]setColor[/color](255, 255, 255);
  myGLCD.[color=#CC6600]setBackColor[/color](0, 0, 0);

  myGLCD.[color=#CC6600]setFont[/color](BigFont);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]" !\"#$%&'()*+,-./"[/color], [color=#006699]CENTER[/color], 16);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"0123456789:;<=>?"[/color], [color=#006699]CENTER[/color], 32);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"@ABCDEFGHIJKLMNO"[/color], [color=#006699]CENTER[/color], 48);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"PQRSTUVWXYZ[\\]^_"[/color], [color=#006699]CENTER[/color], 64);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"`abcdefghijklmno"[/color], [color=#006699]CENTER[/color], 80);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"pqrstuvwxyz{|}~ "[/color], [color=#006699]CENTER[/color], 96);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"by aitendo"[/color], [color=#006699]CENTER[/color], 150);

  myGLCD.[color=#CC6600]setFont[/color](SmallFont);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]" !\"#$%&'()*+,-./0123456789:;<=>?"[/color], [color=#006699]CENTER[/color], 170);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"[/color], [color=#006699]CENTER[/color], 182);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"`abcdefghijklmnopqrstuvwxyz{|}~ "[/color], [color=#006699]CENTER[/color], 194);

  myGLCD.[color=#CC6600]setFont[/color](SevenSegNumFont);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"0123456789"[/color], [color=#006699]CENTER[/color], 220);
 
   myGLCD.[color=#CC6600]setFont[/color](BigFont);
  myGLCD.[color=#CC6600]print[/color]([color=#006699]"www.aitendo.com"[/color], [color=#006699]CENTER[/color], 290);
  [color=#CC6600]while[/color](1) {};
}

I think the first thing you should do is get rid of all those stupid colour commands, so that people have a chance of reading and compiling the code..

The next thing is to report on exactly what happens, if anything, and what doesn't.

The Henning Karlsen library is universal, good for a swag of different displays, and has one vital line like

UTFT myGLCD(CTE32HR,38,39,40,41);

which calls the model of the display and the vital pin order. I imagine the pin order really is vital, and probably should come from the manufacturer of the display or the shield that is carrying it. Having said that, a lot of them are the same. The model code does not seem to be critical in that you may get a result without knowing it and just blundering along instead using an example the matches your display's resolution. In my case I didn't even have that. I worked with an example for a 480x320 display using my 400x240, and I have no idea which model it is.

The correct model declaration should be:

UTFT myGLCD(CTE35IPS,38,39,40,41); // note: "IPS" are all capital letters
or
UTFT myGLCD(R61581,38,39,40,41);

Both examples resolve to the same driver. I prefer the actual driver name since you do not have a CTE35 card.
Let us know if that works for you.

Dear Sirs.
i have the same problem, i download a lot of Libraries, but nothing working. I am still looking for. if you have some news , please send me in my email angelsys@angelsys.com.br
tks

DSCF4608.JPG

There are several version of this shield. On the non-lcd side of the board, how many resistor networks do you see? These are the small rectangular surface mount parts marked with the code 103.

I think I have the same protection.
I use the library UTFT.
With the setting, UTFT myGLCD (CTE35IPS, 38,39,40,41);
I had to adjust the color inversion and rotation of 180 °.
I also did not work touch screen calibration, I had to deal with manual settings.
Ota

i tried a lot of libraries, but nothing
my LCD just light on BackLight
i used CTE32IPS CTE35IPS, and a lot , sometimes the compilation was OK, but not work, and others the compilation was fail.

In the "Arduino \ libraries \ UTFT \ tft_drivers " directory must be "r61581".
Ota

i got same problem with the same tft screen. i only changed this line ; UTFT myGLCD(R61581,38,39,40,41);
should it run after changing that line? or should i do more changings.

i also using utft

I have the same problem with this screen, after connecting it displays a white screen.
Still looking for a solution. :frowning:

I have the same problem with this screen, after connecting it displays a white screen.

Try sending some command like fill colour..

Also the UTFT library has examples for most size LCDS have you losaded and tried ?

old driver
http://aitendo3.sakura.ne.jp/aitendo_data/product_img/lcd/arduino/2.6/3.5-R61581/code/UTFT.rar

new driver UTFT
http://www.henningkarlsen.com/electronics/library.php?id=51

if you have this problem, inverted.... colors
replace r61581 for this attachment into \ libraries \ UTFT \ tft_drivers \r61581

use.
UTFT myGLCD(R61581,38,39,40,41);

#include <UTFT.h>

UTFT myGLCD(R61581,38,39,40,41);

void setup()
{
myGLCD.InitLCD();
myGLCD.InitLCD(LANDSCAPE);
myGLCD.clrScr();

.............

sketch

#include <UTFT.h>

extern uint8_t SmallFont[];

UTFT myGLCD(R61581,38,39,40,41);

void setup()
{
randomSeed(analogRead(0));

// Setup the LCD
myGLCD.InitLCD();
myGLCD.InitLCD(LANDSCAPE);

myGLCD.setFont(SmallFont);
myGLCD.fillScr(0,0,0);
}

void loop()
{
int buf[478];
int x, x2;
int y, y2;
int r;

// Clear the screen and draw the frame
myGLCD.clrScr();

myGLCD.setColor(255, 0, 0);
myGLCD.fillRect(0, 0, 479, 13);
myGLCD.setColor(64, 64, 64);
myGLCD.fillRect(0, 306, 479, 319);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1);
myGLCD.setBackColor(64, 64, 64);
myGLCD.setColor(255,255,0);
myGLCD.print("http://electronics.henningkarlsen.com", CENTER, 307);

myGLCD.setColor(0, 0, 255);
myGLCD.drawRect(0, 14, 479, 305);

// Draw crosshairs
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(239, 15, 239, 304);
myGLCD.drawLine(1, 159, 478, 159);
for (int i=9; i<470; i+=10)
myGLCD.drawLine(i, 157, i, 161);
for (int i=19; i<220; i+=10)
myGLCD.drawLine(237, i, 241, i);

// Draw sin-, cos- and tan-lines
myGLCD.setColor(0,255,255);
myGLCD.print("Sin", 5, 15);
for (int i=1; i<478; i++)
{
myGLCD.drawPixel(i,159+(sin(((i*1.13)*3.14)/180)*95));
}

myGLCD.setColor(255,0,0);
myGLCD.print("Cos", 5, 27);
for (int i=1; i<478; i++)
{
myGLCD.drawPixel(i,159+(cos(((i*1.13)*3.14)/180)*95));
}

myGLCD.setColor(255,255,0);
myGLCD.print("Tan", 5, 39);
for (int i=1; i<478; i++)
{
myGLCD.drawPixel(i,159+(tan(((i*1.13)*3.14)/180)));
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(239, 15, 239, 304);
myGLCD.drawLine(1, 159, 478, 159);

// Draw a moving sinewave
x=1;
for (int i=1; i<(47815); i++)
{
x++;
if (x==479)
x=1;
if (i>479)
{
if ((x==239)||(buf[x-1]==159))
myGLCD.setColor(0,0,255);
else
myGLCD.setColor(0,0,0);
myGLCD.drawPixel(x,buf[x-1]);
}
myGLCD.setColor(0,255,255);
y=159+(sin(((i
0.7)3.14)/180)(90-(i / 100)));
myGLCD.drawPixel(x,y);
buf[x-1]=y;
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some filled rectangles
for (int i=1; i<6; i++)
{
switch (i)
{
case 1:
myGLCD.setColor(255,0,255);
break;
case 2:
myGLCD.setColor(255,0,0);
break;
case 3:
myGLCD.setColor(0,255,0);
break;
case 4:
myGLCD.setColor(0,0,255);
break;
case 5:
myGLCD.setColor(255,255,0);
break;
}
myGLCD.fillRect(150+(i20), 70+(i20), 210+(i20), 130+(i20));
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some filled, rounded rectangles
for (int i=1; i<6; i++)
{
switch (i)
{
case 1:
myGLCD.setColor(255,0,255);
break;
case 2:
myGLCD.setColor(255,0,0);
break;
case 3:
myGLCD.setColor(0,255,0);
break;
case 4:
myGLCD.setColor(0,0,255);
break;
case 5:
myGLCD.setColor(255,255,0);
break;
}
myGLCD.fillRoundRect(270-(i20), 70+(i20), 330-(i20), 130+(i20));
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some filled circles
for (int i=1; i<6; i++)
{
switch (i)
{
case 1:
myGLCD.setColor(255,0,255);
break;
case 2:
myGLCD.setColor(255,0,0);
break;
case 3:
myGLCD.setColor(0,255,0);
break;
case 4:
myGLCD.setColor(0,0,255);
break;
case 5:
myGLCD.setColor(255,255,0);
break;
}
myGLCD.fillCircle(180+(i20),100+(i20), 30);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some lines in a pattern
myGLCD.setColor (255,0,0);
for (int i=15; i<304; i+=5)
{
myGLCD.drawLine(1, i, (i1.6)-10, 304);
}
myGLCD.setColor (255,0,0);
for (int i=304; i>15; i-=5)
{
myGLCD.drawLine(478, i, (i
1.6)-11, 15);
}
myGLCD.setColor (0,255,255);
for (int i=304; i>15; i-=5)
{
myGLCD.drawLine(1, i, 491-(i1.6), 15);
}
myGLCD.setColor (0,255,255);
for (int i=15; i<304; i+=5)
{
myGLCD.drawLine(478, i, 490-(i
1.6), 304);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some random circles
for (int i=0; i<100; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=32+random(416);
y=45+random(226);
r=random(30);
myGLCD.drawCircle(x, y, r);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some random rectangles
for (int i=0; i<100; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(476);
y=16+random(289);
x2=2+random(476);
y2=16+random(289);
myGLCD.drawRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

// Draw some random rounded rectangles
for (int i=0; i<100; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(476);
y=16+random(289);
x2=2+random(476);
y2=16+random(289);
myGLCD.drawRoundRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

for (int i=0; i<100; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(476);
y=16+random(289);
x2=2+random(476);
y2=16+random(289);
myGLCD.drawLine(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,478,304);

for (int i=0; i<10000; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
myGLCD.drawPixel(2+random(476), 16+random(289));
}

delay(2000);

myGLCD.fillScr(0, 0, 255);
myGLCD.setColor(255, 0, 0);
myGLCD.fillRoundRect(160, 70, 319, 169);

myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("That's it!", CENTER, 93);
myGLCD.print("Restarting in a", CENTER, 119);
myGLCD.print("few seconds...", CENTER, 132);

myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 255);
myGLCD.print("Runtime: (msecs)", CENTER, 290);
myGLCD.printNumI(millis(), CENTER, 305);

delay (10000);
}

831840388.jpg

831840584.jpg

r61581.zip (1.46 KB)

Hello.

I've been reading your post and would like to know: do you have the pinout configuration of this shield in order to connect the Arduino uno?

Tks.

Just seen post ...

To many i/o pins for a UNO !!!

If somebody still have an problems with 3.5 TFT display, with R61581 controller, try use this library:

https://docs.google.com/file/d/0B6Z9Lw2binl0S1BwVXdZOWZESmd4OGw0SFpGYzJsbl9reGZn/edit

Firstly complete delete previous UTFT library and use library posted above.

For my R61581 controller 3.5 TFT display, this library worked with:

UTFT myGLCD(ITDB32WC,38,39,40,41);

so, dont change controller type.

What about the built in SD socket it has? Has any1 managed to read images from the SD card and
display them on screen ?
If so, is it possible to provide instructions on how it can be done???

The SD card is not covered by the display library and depends entirely on the shield. I imagine it is typical that you have to bridge across pads or use a jumper before you can use the SD. You also need to know which pis is used to select the card, it might not be the usual pin 4. In my case it was pin 53, i.e. it is called for both select and output.

#include <SD.h>
// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 53;    

void setup()
  pinMode(53, OUTPUT);

I believe that display is a 16bit ILI9327.

Worth a try:

UTFT myGLCD(ILI9327_16 ,38,39,40,41);

This link helped me get started. I have the 3.5" TFT LCD, with DCCduino Kit. It also works with the Arduino Mega.

https://drive.google.com/file/d/0B6Z9Lw2binl0S1BwVXdZOWZESmd4OGw0SFpGYzJsbl9reGZn/edit

Note: You don't need a shield with this screen as it has a separate header strip for the power.

The shield is only used for those screens with one pin header strip.