Hi!
Recently I have bought an cheap chinese tft display. After a bit of googling I have found many tutorials. Unfornamently no one worked. On forums they have found a soultion. People were using wrong library, so it stayed only white. The right one sloud be modified for that Samsung chip. (QDtech) All people were happy that it is working.
But it was two years ago. I don´t see any newer posts so it looks like that this problem has disapeared. Well it actualy didn't. I saw some comments on YouTube and other websites. These people has same problem as me - TFT works, but it just displays "random" colored lines. They are not actually random. They have same patern after every reset. These people have newer found a soultion.
That's why I'm here. They didn't have found soultion. Your response will help many people. If not, it will help at least me. Thank you.
Unfortunately those displays can be fitted with 3 different controllers and the controller can be connected to the display in different ways. Thus some folk find a solution works for their display but it does not work for someone else. There are also lots of mistakes that can be made, from wiring errors, wrong logic levels, wrong sketch or library settings, wrong driver library, wrong interface settings.
Post a picture of the front and back, or at least a link to the sellers web page for that product, that may help forum readers identify it.
The fact that you got some colours on the screen is promising.
I see the ribbon that comes off the display itself is at the opposite end of the PCB to mine. So you may have a different driver.
I have run the Samsung QDTech code with an ST7735 screen attached and I get a lot of stripes on the display. Since you get the same then this suggests you have an ST7735 fitted. So try that library (Adafruit_ST7735_AS) which was also part of the set you downloaded and the rainbow example.
The clock examples will not work as the latest IDEs require one of the functions (i.e. conv2d(const char* p)) to be defined early on in the sketch.
Now it works nearly perfect with the st7735 library. The only problem is that it displays some random pixels on sides. Photo: https://drive.google.com/file/d/0B20kxB_oQWRPaklid3BZQmhSdXc/view?usp=sharing (sorry but it didn't work when I marked it as an photo)
I have actually tried two libraries, so I missed the right one
Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp: In constructor 'TFT_ST7735::TFT_ST7735(int16_t, int16_t)':
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:40:11: error: 'TFT_CS' was not declared in this scope
_cs = TFT_CS;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:41:11: error: 'TFT_DC' was not declared in this scope
_dc = TFT_DC;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:42:11: error: 'TFT_RST' was not declared in this scope
_rst = TFT_RST;
^
In file included from C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:18:0:
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:83:27: error: the value of 'TFT_DC' is not usable in a constant expression
#define TFT_DC_D FastPin<TFT_DC>::hi()
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:50:3: note: in expansion of macro 'TFT_DC_D'
TFT_DC_D;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:41:11: note: 'TFT_DC' was not declared 'constexpr'
_dc = TFT_DC;
^
In file included from C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:18:0:
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:83:33: error: could not convert template argument 'TFT_DC' to 'unsigned char'
#define TFT_DC_D FastPin<TFT_DC>::hi()
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:50:3: note: in expansion of macro 'TFT_DC_D'
TFT_DC_D;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:50:11: error: invalid type in declaration before ';' token
TFT_DC_D;
^
In file included from C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:18:0:
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:82:26: error: the value of 'TFT_CS' is not usable in a constant expression
#define TFT_CS_H FastPin<TFT_CS>::hi()
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:53:3: note: in expansion of macro 'TFT_CS_H'
TFT_CS_H;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:40:11: note: 'TFT_CS' was not declared 'constexpr'
_cs = TFT_CS;
^
In file included from C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:18:0:
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:82:32: error: could not convert template argument 'TFT_CS' to 'unsigned char'
#define TFT_CS_H FastPin<TFT_CS>::hi()
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:53:3: note: in expansion of macro 'TFT_CS_H'
TFT_CS_H;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:53:11: error: invalid type in declaration before ';' token
TFT_CS_H;
^
In file included from C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:18:0:
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp: In member function 'void TFT_ST7735::writecommand(uint8_t)':
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:81:27: error: 'TFT_DC' was not declared in this scope
#define TFT_DC_C FastPin<TFT_DC>::lo()
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.cpp:118:3: note: in expansion of macro 'TFT_DC_C'
TFT_DC_C;
^
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:81:33: error: template argument 1 is invalid
#define TFT_DC_C FastPin<TFT_DC>::lo()
C:\Program Files (x86)\ArduinoCC\libraries\TFT_ST7735-master\TFT_ST7735.h:83:33: error: could not convert template argument 'TFT_DC' to 'unsigned char'
#define TFT_DC_D FastPin<TFT_DC>::hi()
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Note: This is shorter version because of character limit.
Ok random pixels had disappeared when I have defined screen protector tab color to red.
But some colors are inverted.
I have removed the screen protector, but I think that color of the tab wasn't red.
I'm wondering if it's color wasn't blue...
Since you found the REDTAB looked OK apart from the colour inversion, then the BLACKTAB option should correct that. So that option section of the User_Setup.h file should look like:
Unfortunately red and blue are swapped. I have tried all of these options, but there is no one working right. I think that I need to change color settings of this library to fit my display. But how...
Thank you too! Now it works fine.
I was wondering if there is any difference between IDE from arduino.cc and arduino.org, because org's compilation is much smaller than cc. Now I know it, because there are these pixels when it's compiled in org, and when it's compiled in cc they aren't.
Or maybe it is another bug? I have tried it before this update in both of these programs, and it didn't work.
Great, it is good to hear you have it working fine.
I have .cc's 1.6.9 IDE loaded and .org's 1.7.10 and there is only a tiny difference. Bear in mind that the number of fonts enabled in User_Setup.h and some of the other options makes a big difference to the sketch size.
In IDE 1.6.9 the TFT_graphicstest_PDQ3 example with just the GLCD font enabled reports the size as:
Sketch uses 23,104 bytes (71%) of program storage space. Maximum is 32,256 bytes.
Global variables use 252 bytes (12%) of dynamic memory, leaving 1,796 bytes for local variables. Maximum is 2,048 bytes.
Whereas 1.7.10 reports:
Sketch uses 23,102 bytes (71%) of program storage space. Maximum is 32,256 bytes.
Global variables use 248 bytes (12%) of dynamic memory, leaving 1,800 bytes for local variables. Maximum is 2,048 bytes.
So there is only a small difference. So make sure User_Setup.h is set identically for both IDE's