Barry_S:
Thanks for all your hard work David. If it wasn't for your MCUFriend library I would have never gotten my display to do anything. I'm fairly new to programming and It’s probably obvious to most, but after searching for several weeks I'm still trying to figure out the significance of the # that precedes many of the keyword2's in the Mcufriend_kbv keywords.txt file.
My sketch begins with:
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
and the examples show that one preceeds the keywords without an # with tft. but how does one use the keywords with an #. In particular I’ve been trying to make use of printNumF, but all I ever get is errors, such as 'class MCUFRIEND_kbv' has no member named 'printNumF'. (I’m guesing some other library is also needed.)
MCUFRIEND_kbv uses regular "Print.h" methods e.g.
tft.print(0.1234567) and tft.print(9.87654, precision)
You have to use tft.setTextCursor() to position where to start printing.
Obviously there is also println() which positions the cursor to the next line afterwards.
UTFTGLUE has a method called printNumF() with a description in the UTFT docs.
I suggest that you stick to the regular Adafruit_GFX.h and Print.h methods in new projects.
Only use UTFTGLUE if you have a legacy UTFT program.
If you want help, post a link to the original working UTFT sketch.
Or explain what you want to do for a new project.
I tried to run your graphicstest om my arduino Uno but it keeps on failing to build, could you help me please as i'm quite new to this.
This is the Error i get while building:
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino: In function 'void loop()':
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:141:5: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
};
^
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:141:5: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:141:5: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:141:5: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:142:58: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char *colorname[] = { "BLUE", "GREEN", "RED", "GRAY" };
^
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:142:58: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:142:58: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino:142:58: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\User\AppData\Local\Temp\cceWWwOn.ltrans0.ltrans.o: In function `pushColors':
C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv/MCUFRIEND_kbv.cpp:664: undefined reference to `penguin'
C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv/MCUFRIEND_kbv.cpp:664: undefined reference to `penguin'
C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv/MCUFRIEND_kbv.cpp:665: undefined reference to `penguin'
C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv/MCUFRIEND_kbv.cpp:665: undefined reference to `penguin'
collect2.exe: error: ld returned 1 exit status
And this is what the LCD_ID_readreg gives:
Attached picture of it.
Edit: Finally got it loaded onto my arduino by moving the files. Still problem remains that my screen stays full white.
Hello David,
i am back to you with my problems.
I wish to write programs for 2 differents displays in the same time and i have a libraries problem.
First : i use 2,4" TFT LCD Shield from mcufriend (Ili9325 and ST7789V) with the the latest versions of Adafruit_GFX.h and MCUFRIEND_kbv.h without any problems. Fine.
Second : i want to use OPEN-SMART shield with larger display
Dealextreme link
not running. Screen is white and "flash" from time to time.
I found their libraries and example here :
Google Drive link
They use the same libraries as you but not the same size ???
Their MCUFRIEND_kbv.cpp is 93560 and your is 114219
Their MCUFRIEND_kbv.h is 2227 and your is 2550
Same for Adafruit_GFX
Their Adafruit_GFX.cpp is 16213 and the latest official revision is 43410
Their Adafruit_GFX.h is 3944 and the latest official revision is 7554
Their cards use "ILI9327 Special" and "HX8352B" chips (i have one of each).
Open-Smart shields used a different wiring as Mcufriend but are directly plugable on Aduino Uno board.
My request :
Where is the "link" between the library and the electrical wiring ?
Did you have any idea how to solve my problem ?
Many thanks in advance
Jacques
Apologies for my bad English, i am french (belgian) user
I tried to run your graphicstest om my arduino Uno but it keeps on failing to build, could you help me please as i'm quite new to this.
This is the Error i get while building:
C:\Users\User\AppData\Local\Temp\Temp1_MCUFRIEND_kbv-2.9.3.zip\MCUFRIEND_kbv-2.9.3\examples\graphictest_kbv\graphictest_kbv.ino: In function 'void loop()':
...
Please Install/Upgrade your library with the Library Manager. The current version is v2.9.7
I do not recognise your controller from the LCD_ID_readreg sketch.
Perhaps the current library can find the ID.
Please copy-paste from the Serial Terminal instead of posting a screenshot.
JMe87:
Hello David,
i am back to you with my problems.
I wish to write programs for 2 differents displays in the same time and i have a libraries problem.
First : i use 2,4" TFT LCD Shield from mcufriend (Ili9325 and ST7789V) with the the latest versions of Adafruit_GFX.h and MCUFRIEND_kbv.h without any problems. Fine.
Second : i want to use OPEN-SMART shield with larger display
You can use OPEN-SMART with a Uno or Mega by editing these files:
MCUFRIEND_kbv.cpp: #define SUPPORT_8352A
mcufriend_shield.h: #define USE_SPECIAL
mcufriend_special.h: #define USE_OPENSMART_SHIELD_PINOUT
The "editing" involves removing the two slash characters on those lines.
When you are building for the OPEN_SMART boards, define USE_SPECIAL
When you are building for the regular Shields, comment the USE_SPECIAL define
You can leave the other edits unchanged.
The ILI9327 should work by default. I am not sure whether the HX8352-B will work with my HX8352-A code. Please let me know.
david_prentice:
Please Install/Upgrade your library with the Library Manager. The current version is v2.9.7
I do not recognise your controller from the LCD_ID_readreg sketch.
Perhaps the current library can find the ID.
Please copy-paste from the Serial Terminal instead of posting a screenshot.
David.
After some more research i think my display has the hx8347-g chip, i couldn't find much about it, do you have any idea?
My IDE is Arduino 1.8.3 Look on the title of every sketch window.
I suggest that you install v2.9.7 from the Library Manager. It gives specific instructions for HX8347 variants.
If your IDE or Library is out of date, update it. Definitely replace any v1.7.x IDE.
Don't worry about the very latest IDE. Anything later than 1.6.12 should be ok.
Its Ok, I understand. But when I run your "showBMP_not_Uno" (that contains "tft.readID()") the display shows all images like color "negative" (X-ray). Do you know what am I doing wrong?
david_prentice:
My IDE is Arduino 1.8.3 Look on the title of every sketch window.
I suggest that you install v2.9.7 from the Library Manager. It gives specific instructions for HX8347 variants.
If your IDE or Library is out of date, update it. Definitely replace any v1.7.x IDE.
Don't worry about the very latest IDE. Anything later than 1.6.12 should be ok.
David.
My IDE is Arduino 1.8.5 (latest)
The mcufriend library is v2.9.6, there is no 2.9.7 in library manager available for me.
It gives me device ID: 0xD3D3
Im really confused about what driver chip my screen has now, as no information was given about it. i really appreciate the help.
david_prentice:
Well, I released v2.9.7 a few weeks ago. My Library Manager offers v2.9.2-Beta through to v2.9.7
Looking at your LCD_ID_readreg report. It is complete garbage. Just like you would get from a write-only shield. Please note:
Please post a link to the actual shield that you have on your desk. e.g. Ebay link or your own photo of the pcb.
There is no pictures on the back, but all that's on the back is an SD card reader and two sum74hc245t chips, no resistors no nothing. just the text www.mcufriend.com and 2.8" TFT LCD Shield.