For now, we're working with simple code to output words on our screen. Here it is:
#include <UTFT.h>
//Declare which fonts we will be using.
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD (ITDB32S,38,39,40,41); // Remember to change the model parameter to suit your display module!
void setup()
{
myGLCD.InitLCD(LANDSCAPE); //Landscape mode selected.
//Just in case, manually initialize the pins to be used.
pinMode(38, OUTPUT);
pinMode(39, OUTPUT);
pinMode(40, OUTPUT);
pinMode(41, OUTPUT);
//myGLCD.clrScr();//I'm not sure what this actually means.
myGLCD.setFont(BigFont);
}
void loop()
{
myGLCD.setBackColor(VGA_BLACK);//Set background color to Black.
myGLCD.setColor(VGA_WHITE);//Set the word colors to White.
myGLCD.print("Welcome to the Norfolk Heart Patient Simulator.", CENTER, 0);
while(true){};
}
We're beginners so please bear with us. The screen backlight is on, but whenever we upload the code it doesn't output the words onto the screen. Still, the code compiles without any errors.
Do you have any advice on how to make the words actually appear on the screen?
Wait a second, when I did my senior project I didn't have an international forum of experts to consult.
Isn't that cheating ? Do you have a permission note from your teacher ?
Not a note, but he did tell us to consult the forum to get help with the Arduino; this is our first time even using the board, which is why he advised us to do so. As a disclaimer, I'm not asking you or anyone to write the code for us. Just a little help would do.
As I stated in the original post, the program compiles without any errors, yet the expected outcome does not show on the screen. For anyone willing to help, is there anything in particular that we're doing wrong?
For starters, delete your original post (using "REMOVE" button) and redo it correctly using the
the CODE button , the one with the "#" on it , so people can scroll through the code..
You should think of this more as a [SCROLL WINDOW] button because if you have a lot of info, like a
compiler output , you can post it as if it were code and then people can scroll down the lines.
It just makes it more readable.
Next, when you post here you need to start by identifying your hardware.
I see no mention of WHICH Arduino in your post so please identify your uController.
Next, you are using the UTFT library, but how did you install it ?
If you have no Arduino experience then how do we know that you are even aware of the very most basic
rules of libraries , or anything else Arduino related, such as the sketch folder location importance ?
Have you done a "File\Preferences " yet ?
The TFT will work with UTFT on the Uno and the Mega with 0023 and the 1.0.1 IDE. Also the SainSmart lib will work. However, Arduino Due was not mentioned (in fact probably not available at that time), so maybe there is an incompatibility between the Due and the TFT and/or UTFT.
Typical problems include:
3.3V: Due is a 3.3V device, all other Boards are 5V. Maybe the TFT expects 5V
Pin assignments. Maybe different pins need to be used for the Due
Due not supported in UTFT: Problem is, nobody can test all cominations. So UTFT might be compatible in general with the Due, but maybe the specific shield is not supported.
How to track down the problem:
Try to figure out whether the correct signals are applied to the TFT shield. Best is to use a scope...
For starters, delete your original post (using "REMOVE" button) and redo it correctly using the
the CODE button , the one with the "#" on it , so people can scroll through the code..
I think it would be a lot better for him to go back and edit his original post with the correct tags instead of removing and redoing it.
I think I know what the problem is.
I think you are using a SPI interface and you have not redefined your pins for the DUE.
There is a post about this where the guy discovered he should be using pins 75 & 76 instead of the other
pins used on a Mega because on the DUE the only SPI pins are on the 6-pin SPI connector in the center
of the DUE. There are not brought out to the shield pins. I will find the post and get back to you
later but I think that is your problem, unless you can tell us you are already aware of that.
Did your re-define these ports (done on the MEGA)
Code: #define TFTcs 53 #define TFTsclk 52 #define TFTmosi 51 #define TFTdc 49 #define TFTrst 48
for the DUE ?
Thank you! That's right note! The answer is no - and that is the reason for the failure. The display started working after I've changed the definition:
Did your re-define these ports (done on the MEGA)
Code: #define TFTcs 53 #define TFTsclk 52 #define TFTmosi 51 #define TFTdc 49 #define TFTrst 48
for the DUE ?
Thank you! That's right note! The answer is no - and that is the reason for the failure. The display started working after I've changed the definition:
Thanks a lot everyone. I modified the original post with more information on the hardware we're using.
As Olikraus stated, the UTFT library may not be compatible with the Due. (I thought I previously saw a forum post that stated it was, but it might've been incorrect).
I need to look at my pin assignments since I'm using the TFT Shield V2.1.
Look at the vendors website for a statement to the effect that the shield is "Plug & Play compatible with the "classics".
If it says that it means UNO , and Mega but maybe not the Due.
Look for the 6-pin SPI connector (see attached).
Oh yeah, DUH !
I never noticed that.
Thanks.
That's dangerous.
Now I can go back and change all the incorrect statements I made in the past after someone else corrects me...
Hey guys,
Is this any help ?
see attached.
NOTE THE WIRE CONNECTIONS TO 6-PIN SPI CONNECTOR IN MIDDLE OF BOARD.
Sound familiar ? (the same one I mentioned)
If I'm not mistaken you don't have anything connected to the 6-pin SPI connector at the moment ?
UTFT myGLCD (ITDB32S,[b]38,39,40,41[/b]); // Remember to change the model parameter to suit your display module!
If you don't mind me asking , what DUE pins are you currently using and why are the only ones mentioned for the display ?
What other pins are you connecting for communication with the TFT ?
On an Arduino UNO those pins on the ISP connector are brought out to D10,11,12,& 13.
If you have a "SHIELD" plugged into it then you don't have too many options.
It is either compatible or you have to distance yourself from DUE (literally, that is physically).
If you insert MALE:FEMALE headers as spacers then you can cut the ones you don't want connected and run the wires
some other way, like from a 6-pin connector plugged into your ISP connector to the pins on your shield , that have the
pins cut on their spacer headers so the wires soldered to TFT pins will be the only connection.
There is no reason why it shouldn't work, but at most your talking about 6 pins that have to be rerouted.
Anyone would look at it and probably not even notice that the cable on top is soldered at the other end
of the ribbon cable at the TFT bd.
raschemmel:
Hey guys,
Is this any help ?
see attached.
NOTE THE WIRE CONNECTIONS TO 6-PIN SPI CONNECTOR IN MIDDLE OF BOARD.
Sound familiar ? (the same one I mentioned)
If I'm not mistaken you don't have anything connected to the 6-pin SPI connector at the moment ?
UTFT myGLCD (ITDB32S,[b]38,39,40,41[/b]); // Remember to change the model parameter to suit your display module!
If you don't mind me asking , what DUE pins are you currently using and why are the only ones mentioned for the display ?
What other pins are you connecting for communication with the TFT ?
On an Arduino UNO those pins on the ISP connector are brought out to D10,11,12,& 13.
If you have a "SHIELD" plugged into it then you don't have too many options.
It is either compatible or you have to distance yourself from DUE (literally, that is physically).
If you insert MALE:FEMALE headers as spacers then you can cut the ones you don't want connected and run the wires
some other way, like from a 6-pin connector plugged into your ISP connector to the pins on your shield , that have the
pins cut on their spacer headers so the wires soldered to TFT pins will be the only connection.
There is no reason why it shouldn't work, but at most your talking about 6 pins that have to be rerouted.
Anyone would look at it and probably not even notice that the cable on top is soldered at the other end
of the ribbon cable at the TFT bd.
Yep, this has been very helpful.
As far as the 6 SPI pins, the shield we're using consists of female connectors that interface directly with the SPI pins. I've attached a few pictures of the setup thus far (the white device in the back isn't connected to the board. I'm only using it to hold the screen up.) The website says that the shield and screen are specifically designed for the Due (and Plug + Play capable). http://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=148_211&products_id=2217
Zoom in on the right half of the attached photo of the DUE and you will see THAT 6-pin connector is
silk-screen labeled "SPI". (the one I mentioned in one of my first replies). If you zoom in on the OTHER
photo you will see that the TFT has a little narrow "handle" part that has a mating connector for the
SPI connector. So as far as I can tell, the TFT was designed to utilize that connector but not obstruct
everything else on the board you might want to use, like all the other shields that plug into the top
of an UNO, look like they will still fit. The display should work. I'm puzzled too.